-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support overrides #317
Comments
The intention is generally for all rules to be defined for every file; in your case, you could define them all at the root, and only enable them in the overrides? |
@ljharb That would be really cumbersome to duplicate all rules. For now it's only for @typescript-eslint rules, but this can become more in the future. Like I said: I'm happy to implement it myself if you could point me in the right direction. 🙂 |
@MichaelDeBoey the airbnb config defines every single rule in eslint core, eslint-plugin-import, eslint-plugin-react, and eslint-plugin-jsx-a11y. It's a one-time cost that eslint-find-rules helps keep up to date with minimal incremental effort. In your case, you could easily define them once in a JS object, and then add that object in two places: the root, off; and overrides, as "error". |
Hi @ljharb 👋 It's been a while! Hope you're doing awesome. Are you opposed to someone adding support for this? Seems like what you're suggesting is more of a workaround than a desirable "feature" 🙃 |
@kentcdodds to be specific, it seems like what you're asking is for Based on the existence of |
That makes sense :) I'd definitely use a |
@ljharb Could you point me into the right direction please? |
I'm not entirely sure :-) i'd start with tests tho |
@MichaelDeBoey did you ever figure this out? |
@saiichihashimoto I never had the time to look into this. |
I spent some time on this today, and have it working - ESLint v7 added better support for merging in override rules when building the config. The downside is it would require v7 as the lowest peer dependency to support as CLIEngine is now deprecated. Also it doesn't seem to pickup any plugins that are defined in an |
A new use-case we have on Enabling all the rules in the root just to make our tests happy isn't the preferred way, so this feature could benefit us a lot. @leepowelldev Do you have the time to create a PR with working version of this or should we look into it ourselves? |
Overrides are not supported, yet, so some rules were missed. See: sarbbottam/eslint-find-rules#317
My workaround is to define high-level configurations (containing
So while
When checking |
Fixes sarbbottam#317. Co-authored-by: nicolaichuk <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
Fixes sarbbottam#317. Co-authored-by: nicolaichuk <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
When adding TypeScript support in
eslint-config-kentcdodds
(see kentcdodds/eslint-config-kentcdodds#54), I noticed CI isn’t failing even though I haven't added all @typescript-eslint rules (yet).I'm happy to help out if you could point me into the right direction of adding support here. 🙂
The text was updated successfully, but these errors were encountered: