verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.05k stars 1.99k forks source link

`yarn test` fails with linting error #232

Closed urbanlegion closed 6 years ago

urbanlegion commented 7 years ago

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:

Did I miss anything here? thx

djtorel commented 7 years ago

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

verekia commented 7 years ago

Exactly, let's hope for a fix soon :) In the meantime, stick to 3.19.0!

verekia commented 6 years ago

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: https://github.com/airbnb/javascript/issues/1447#issuecomment-317335861