-
Notifications
You must be signed in to change notification settings - Fork 214
ESLint to source code only. #189
Comments
Yeah, I think something might have been changed, because I'm pretty sure we had it set at one point that ESLint operates against only the source directory. Looking at the lint middleware: My guess is we would want to set this to |
What you mentioned is a different thing. This checks files when they are resolved through the dependency tree. What I am talking about is the editor validation errors. The editor just grubs the ESLint rules generated from the Neutrino and applies them to any files it wants without considering Webpack include and exclude. Tell me if I am wrong. |
Ah I see now. You are correct; there is no way to specify this information in the configuration. I remember seeing an issue to change this in the eslint repo somewhere, but I don't have it off hand. Instead, you should probably whitelist the files you want linted, like we do in neutrino-dev: eslint packages/*/*.js packages/*/src/**/*.js packages/neutrino/bin/* Essentially you would want to lint your source: eslint src/**/*.js --ext .js,.jsx Something like that. Since ESLint doesn't accept file parameters from configuration, there is no simple way to have their CLI respect eslint $(get_source_glob) |
I have investigated this problem deeper. You seem to be right that we can't configure it by ourselves. And I think I even found the issue you mentioned in their repository eslint/eslint#3529. So what solution I found. Manually configure it using |
Done in #205 |
Currently if ESlint presets are installed in the project the rules are applied to all files starting from the root. Exceptions are
node_modules
andbower_components
that are excluded by default in the ESLint. We need to apply ESLint rules only to source files (./src
by default).What the problem is:
Lets say you use VSCode and configure everything to integrate project ESLint rules to the editor and to autoformat files on save. In this setup there is no chance to save files that are not ESLint valid. This breaks local custom middlware for the advanced Neutrino configuration. For example ESLint may add trailing commas which will break NodeJS interpretator when
neutrino start
.The text was updated successfully, but these errors were encountered: