I'm using CRA v1.4.1.
{
"root": true,
"extends": "airbnb",
"plugins": ["react"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true,
"browser": true
},
"parser": "babel-eslint",
"rules": {
"strict": 0
}
}
The build fails with several errors (JSX not allowed in files with extension '.js', and many in registerServiceWorker.js).
The default react-app
config is very limited (eg. it doesn't enforce semicolons) and airbnb is the de facto standard so would be cool if CRA can be fixed to comply to it by default.
This isn't a concern of CRA; if you've ejected it's up to you to fix your ESLint configuration or errors.
Sorry!
Also, react-app config is strictly for finding errors -- we do not enforce style. You should not use eslint to enforce style. Use a tool like Prettier to enforce style.
This is still an issue without ejecting, so I think it is an issue with CRA.
@Timer I have this issue ejecting the app, but the issue is CRA fails to compile because custom ESLint rules are being broken, even though it should still build just fine.
I run in to this issue today after ejecting an app. Found this thread and started fixing the src/registerServiceWorker.js to satisfy the airbnb-linting errors.
To me it's clearly an issue tied to the linting not the src/registerServiceWorker.js
.
Different linting rules might trigger different errors so attempting to fix the src/registerServiceWorker.js
seems futile.
Just my 2cents
If you have behavior that seems to be a bug, please file a new issue. Thanks!
Most helpful comment
This is still an issue without ejecting, so I think it is an issue with CRA.