Is it worth to set the option parserOptions.sourceType as module in the lib/.eslintrc.yaml? What are pros / cons / breaking changes?
Why don't we use the option root as true in the main .eslintrc.yaml ?
By default, ESLint will look for configuration files in all parent folders up to the root directory. This can be useful if you want all of your projects to follow a certain convention, but can sometimes lead to unexpected results. To limit ESLint to a specific project, place
"root": trueinside theeslintConfigfield of thepackage.jsonfile or in the.eslintrc.*file at your project鈥檚 root level. ESLint will stop looking in parent folders once it finds a configuration with"root": true.
Would it spare the linter some fs churn / time?
cc @not-an-aardvark, @silverwind, @trott
2. makes sense to me.
@gibfahn I think it can even prevent some murky bugs: if somebody forgetfully leaves some .eslintrc config in a parent directory above node repo directory, some node rules can be overwritten.
'use strict'; statementsreturn in the top scope why do you want to enable it? We don't have any module files yet, do we?
@silverwind
root: true
at the top of the main .eslintrc.yaml?
Is it worth to set the option
parserOptions.sourceTypeasmodulein thelib/.eslintrc.yaml?
No. That would be incorrect as those rules are for ES Modules, e.g. no top-level return as silverwind mentioned.
Most helpful comment
No. That would be incorrect as those rules are for ES Modules, e.g. no top-level
returnas silverwind mentioned.