Scripts: Add missing root flag to the default Eslint config#13483
Scripts: Add missing root flag to the default Eslint config#13483
Conversation
bb3e158 to
e23f449
Compare
There was a problem hiding this comment.
Trying to test this, I still see that ESLint will inherit rules from parent directories.
I think we need to use--either instead of or in addition-- the --no-eslintrc-js parameter when falling back to the default-provided configuration.
Here:
To:
[ '--no-eslintrc', '--config', fromConfigRoot( '.eslintrc.js' ) ] :
aduth
left a comment
There was a problem hiding this comment.
Added the proposed change. Feel free to merge if it makes sense to you.
|
I see this line in ESlint docs and it suddenly makes everything clear:
Thanks for catching it. I didn't think about configs located outside of the project at all. Never stop learning :) |
|
Kudos @aduth for changes applied 🥇 I will merge as soon as Travis will turn green. |
* Scripts: Add missing root flag to the default Eslint config * scripts: Instruct ESLint to avoid config discovery in defaulting
* Scripts: Add missing root flag to the default Eslint config * scripts: Instruct ESLint to avoid config discovery in defaulting
Description
Extracted from #13394 based on a suggestion from @aduth:
https://github.com/WordPress/gutenberg/pull/13394/files#r249797548
This PR adds missing
rootflag in the default ESlint config which works as explained in the docs (https://eslint.org/docs/user-guide/configuring):Testing
Not sure how to test with the recent configs added which depend on the
.eslintrc.jsin the root folder. Otherwise I would remove it and check whethernpm run lint-jsworks.