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
Provide "import:all" preset #551
Comments
Hi @nicolo-ribaudo! Thanks for the proposal, though I'll have to say I'm not a big fan of this. I argued against it when the proposal was made in the ESLint repo. For me, this brings a few problems:
I'd recommend either copy-pasting the configuration in your config (for the core rules, this plugin doesn't do that) and trying that out (fast way), or to take some time to look at the rules and make some opinions up front on the rules to turn on (slow way). I'd recommend using tools like https://github.com/sarbbottam/eslint-find-rules/ to stay up to date with new rules. @ljharb I saw that you participated in the discussion for the react plugin. Would you like to share your opinion on this? |
These are all very good points. I generally think of an "all" config with anything turned on as exempt from semver-major rules, otherwise minor couldn't exist. In a top-level app, your first two points don't apply, since naturally you'd be using shrinkwrap. In a reusable package, though, that's definitely a possibility when using Maintainers should be making opinionated choices on the settings (including keeping the defaults) imo, so that doesn't bother me. I use To sum up, "all" config seems perfectly fine with appropriate documentation - users can get that semantic anyway by using eslint-find-rules programmatically in an eslint config JS file, and it seems silly to force that on the users who want it. |
Great points from both @jfmengels and @ljharb. I'm going to say no, at least for now. I agree with @ljharb that
but there are a few reasons I don't want to do this, at least right now:
and, mostly:
I think the It's arguable that given the conservative stance they take toward accepting rules, that ESLint's Whether or not that's true, I'm pretty confident it's not true of this plugin. I do my best not to be too opinionated about what rules I accept from the community. If folks have use cases I don't, I'm fine to support them, but accepting a rule PR does not imply that I think everyone can/should use it. Also, FWIW: anyone could build an publish a shared config with every rule turned on, and spend the time and energy to decide what the settings should be. Though I'm tempted since there is a precedent in ESLint proper and other plugins, I don't think it makes sense for this plugin. 😄 |
Would love to have this as well. It's pretty extensively argued in the other thread, so won't rehash here, but you can see some of what I had to say on the topic here. As a user of your library, and knowing what I'm opting into, it's a pretty nice convenience to not have to go checking for new rules when I upgrade, and to not have to configure a bunch of already reasonable defaults. It compounds when you've got a number of linters integrated, such as Rubocop and SCSS Lint. |
@mockdeep use |
@ljharb Correct me if I'm wrong, but it looks like that configuration forces you to manually configure every single rule. My hope (and generally, experience) is that for the vast majority of rules, the defaults are reasonable, so I really just want to configure the rules that depart from the defaults in my configuration file, and for the rest enforce them as is. |
It's surprising that after 7 years, we still haven't seen this happen. In my opinion, what developers really need is not a rigid and conflict-free set of rules. Instead, we should enable all the rules, even if some of them shouldn't coexist, like If the author still believes that implementing this isn't worthwhile, I have created a minimalist shared config called eslint-config-import-strict with a rule set named I am also contemplating the creation of an |
Some plugins (like "eslint-plugin-react") and ESLint itself provide a preset to enable every option, which is used to have the most strict configuration by default.
Can this plugin provide such preset?
Example:
The text was updated successfully, but these errors were encountered: