`yarn test` fails with linting error
urbanlegion opened this issue · 3 comments
yarn test
fails with linting error:
Unexpected top-level property "ecmaFeatures".
here is the the full error:
PS G:\xampp\htdocs\reactFromScratch> yarn test
yarn test v0.24.5
$ eslint src
G:\xampp\htdocs\reactFromScratch\node_modules\eslint-config-airbnb\rules\react.js:
ESLint configuration is invalid:
- Unexpected top-level property "ecmaFeatures".
Referenced from: airbnb
Referenced from: G:\xampp\htdocs\reactFromScratch\.eslintrc.json
Error: G:\xampp\htdocs\reactFromScratch\node_modules\eslint-config-airbnb\rules\react.js:
ESLint configuration is invalid:
- Unexpected top-level property "ecmaFeatures".
Referenced from: airbnb
Referenced from: G:\xampp\htdocs\reactFromScratch\.eslintrc.json
at validateConfigSchema (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-validator.js:187:15)
at Object.validate (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-validator.js:200:5)
at load (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:550:19)
at configExtends.reduceRight.e (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:421:36)
at Array.reduceRight (native)
at applyExtends (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:405:28)
at load (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:557:22)
at configExtends.reduceRight.e (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:421:36)
at Array.reduceRight (native)
at applyExtends (G:\xampp\htdocs\reactFromScratch\node_modules\eslint\lib\config\config-file.js:405:28)
env:
win10 / XAMPP using powershell
I think it would be an issue coming from my install process?
Since I can't use the linux one line: npm info eslint-config-airbnb@latest peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add --dev eslint-config-airbnb@latest
I had to install separately. As follows:
- yarn add --dev glob@^7.1.1
- yarn add --dev markdownlint@^0.4.0
- yarn add --dev eslint
- yarn add --dev eslint-plugin-jsx-a11y@^5.0.1
- yarn add --dev eslint-plugin-import@^2.2.0
- yarn add --dev eslint-plugin-react@^7.0.1
- yarn add --dev eslint-config-airbnb@latest
Did I miss anything here?
thx
This is because the latest version of eslint (4.0.0) is incompatible with the airbnb and jsx-a11y plugins. I was able to fix it by installing eslint@3.19.0.
So do
yarn remove eslint
then
yarn add --dev eslint@3.19.0
Exactly, let's hope for a fix soon :) In the meantime, stick to 3.19.0
!
eslint-config-airbnb
still doesn't support ESLint 4 but eslint-config-airbnb-base
does. In the next version of the tutorial I'll use it.
See: airbnb/javascript#1447 (comment)