-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eslint: config file resolution / multiple config files #1706
Comments
Is there any possibility of getting this functionality? It is becoming a blocker for our continued usage of Hound which we really like. |
@TomasBarry Could you describe how you are using multiple configuration files? As described in the OP, it's not likely to be supported as "Instead of specifying the config file explicitly, you would just specify the files / directories to be linted" because that's just not how Hound works, and we need to preserve the behavior for all the current users. One possible solution for multiple configs could be something like: eslint:
enabled: true
config_files:
- .eslintrc
- .prettierrc
- test/.eslintrc Where the first two files would be placed at the root, and the last tested in |
@gylaz, an exaggeration of our scenario would be a directory structure such as:
Where all 3 So if a change is made to Does that make sense? I believe your suggestion would suit our needs - files in a directory are linted under the rules outlined by the |
In the example you provided, Assuming, |
You are correct, I gave a bad example. Basically, we are following the instructions here to have a root set of rules and then extra rules based on the given directory. But Hound is only running the code against the root set of rules. Our specific example is that the root So we have a file, in the subdirectory that should require a comma dangle in a Pull Request. However, Hound sees the comma dangle as a violation because the root |
Any ideas on this @buschtoens? |
Yes, because in the end Hound shells out to ESLint and let's it do its thing. The only difference is we selectively fetch only the necessary files for the lint to happen.
That's because currently Hound only knows about a single configuration file. |
@gylaz, so is it be possible to inform Hound of the extra |
This is still an issue for us, is there any progress on resolving it? |
Hound currently only supports specifying single ESLint config file to be used for the whole repository. Unfortunately this does not play nicely with monorepos or repositories with different types of JS source files that have different linting requirements.
Quoting from the ESLint docs:
It would be great, if Hound could support / use the same resolution logic for ESLint projects. Instead of specifying the config file explicitly, you would just specify the files / directories to be linted and let ESLint handle the config resolution.
This repo describes why you would want to use different ESLint configs in the same repo:
@clark/eslint-config-ember
Thank you for considering!
The text was updated successfully, but these errors were encountered: