topheman / my-react-app-starter

eslint/prettier/other pre-configured and customisable create-react-app project
https://topheman.github.io/my-react-app-starter/
11 stars 4 forks source link

Update eslint-config-airbnb from v16 to v17 #4

Open topheman opened 6 years ago

topheman commented 6 years ago

updating eslint-config-airbnb from v16 to v17 outputs the following message

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.0 requires a peer of eslint@^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.0 requires a peer of eslint-plugin-import@^2.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.0 requires a peer of eslint-plugin-jsx-a11y@^6.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.0 requires a peer of eslint-plugin-react@^7.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@13.1.0 requires a peer of eslint@^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@13.1.0 requires a peer of eslint-plugin-import@^2.14.0 but none is installed. You must install peer dependencies yourself.

The reason is that eslint-config-airbnb relies on a bunch of modules that are also installed by react-scripts. In the previous version those modules were in the correct version range.

If we follow the instruction and install peer-dependencies:

npm install --save-dev eslint-config-airbnb@^17.1.0 ajv@^6.0.0 eslint@^5.3.0 eslint-plugin-import@^2.14.0 eslint-plugin-jsx-a11y@^6.1.1 eslint-plugin-react@^7.11.0

We end up with an other warning:

npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself.

This warning is about react-scripts dependencies which now have trouble with their peer dependencies because the previous install has done some deduplication of modules.

Action to take

Infos

npm --version
6.1.0
node --version
v8.9.0
tobslob commented 5 years ago

Thank you for posting this command "npm install --save-dev eslint-config-airbnb@^17.1.0 ajv@^6.0.0 eslint@^5.3.0 eslint-plugin-import@^2.14.0 eslint-plugin-jsx-a11y@^6.1.1 eslint-plugin-react@^7.11.0" really helped me to fix this error below

"

Error: C:\Users\TOBI\UIUXDesign\UI\APIs\node_modules\eslint-config-airbnb\rules\react-a11y.j s: Configuration for rule "jsx-a11y/anchor-has-content" is invalid: Value {"components":[]} should be string. Value {"components":[]} should be array. Value {"components":[]} should match exactly one schema in oneOf.

"