Hello, I am building a web app that was scaffolded from create-react-app, but uses airbnb-eslint-config. I have been using this for a few months with no issues, but earlier today, I rm -rf node_modules/ and reinstalled them, and am now getting the following error:
Failed to compile.
Error in ./src/index.js
Module build failed: Error: /Users/rich/Git/web-app/node_modules/eslint-config-airbnb-base/rules/best-practices.js:
Configuration for rule "no-param-reassign" is invalid:
Value "data["0"].ignorePropertyModificationsFor" has additional properties.
Referenced from: /Users/rich/Git/web-app/node_modules/eslint-config-airbnb-base/index.js
Referenced from: airbnb
Referenced from: /Users/rich/Git/web-app/node_modules/react-scripts/.eslintrc
at Array.forEach (native)
at Array.reduceRight (native)
at Array.reduceRight (native)
at Array.reduceRight (native)
@ multi ./~/react-dev-utils/webpackHotDevClient.js ./~/react-scripts/config/polyfills.js ./src/index.js
I've tried overriding this rule in my eslint config:
"no-param-reassign": [0, { "props": false }],
and I've tried:
"no-param-reassign": "off",
All to no avail. Can someone please help me understand what's changed, and what I'm missing?
Updating to the latest version of babel-eslint (7.1.1 => 7.2.1) resolved my issue.
Specifically it's the eslint version that needed updating.
Thanks for the quick response & clarification!
i have same issues, can you helm me? my terminal return:
/../node_modules/eslint-config-airbnb-base/rules/es6.js: Configuration for rule "prefer-destructuring" is invalid: Value "data["0"].VariableDeclarator" has additional properties. Value "data["0"].AssignmentExpression" has additional properties.
Referenced from: /../eslint-config-airbnb-base/index.js
Referenced from: airbnb Referenced from: / /../APP_MOBILE_DEV/Ristorante_JBosse/.eslintrc
@pherm does npm ls exit successfully? if not, nothing can be expected to work.
@ljharb not always, bro. I have some deduped file, extraneous, and some err! can you help me to fix?
please don't call people "bro"
First, try running the install command from eslint-config-airbnb-base or eslint-config-airbnb verbatim, and see if that fixes the problem. If not, please file a new issue and we can work through it.
@ljharb maybe i fixed, can you tell me if this ok?
---.eslintrc.js---
module.exports = {
parser: 'babel-eslint',
plugins: ['react', 'react-native'],
parserOptions: {
ecmaFeatures: {
jsx: true,
modules: true,
},
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'airbnb-base'],
rules: {
'arrow-body-style': 'warn',
},
};
Anyway, i don't undestand, what is the best eslint configuration for react native?? 馃
I'd put the "extends" line first, but otherwise that looks fine. I don't personally use react-native, so I can't help you with that part.
Most helpful comment
Updating to the latest version of
babel-eslint(7.1.1 => 7.2.1) resolved my issue.