eslint-plugin-import
eslint-plugin-import copied to clipboard
Docs: Documentation should be more verbose about the recommended config
Hi,
I was trying to figure why a certain rule wasn't working even though I had enabled plugin:import/recommended. I eventually realised that the recommended config actually doesn't enable that rule. I think it would be super useful to have as https://typescript-eslint.io/rules/ or https://eslint.org/docs/latest/rules/
If there isn't already work in progress about this topic, I would like to implement it ! I was hoping to get some initial feedback / ideas from the maintainers before I get started.
Cheers, Dev
This would be fine if it autogenerated the list using markdown magic; however, people really shouldn’t be using the recommended config - the Airbnb config has the best default config for this plugin.
the Airbnb config has the best default config for this plugin
Airbnb config seems not using TypeScript.
however, people really shouldn’t be using the recommended config - the Airbnb config has the best default config for this plugin.
Could you expound a bit on this please ? Should i be using the airbnb config instead ? Would it be ok, if we used only the import config from airbnb ?
Yes, you should start with the Airbnb config and modify on top of it, including with TS stuff.
@jounqin neither is this plugin’s recommended config.
The airbnb import is indeed way more extensive. I'm relatively new to configuring eslint in depth, so would it make sense to do somthing like extends: [ ..., "airbnb-base:imports"]. If this works, I think it we should mention in the docs that this package works well with airbnb, discourage the use of recommended & maybe create a link to that file ?
I'm also open to the idea of using markdown magic to showcase what errors are enabled in which configs too.
Not everyone uses Airbnb's config.
I think both is probably a good idea.
(In practice it turns out to be a very bad idea for plugins to also provide configs, because of semver constraints)
@JounQin while that’s true, that’s not the same thing as saying they shouldn’t be.
I think i agree with @ljharb here. While not everyone uses airbnb's config (me included), it appears to me that this plugin was built as a part of the airbnb linting (I might be wrong here lol).
Having looked at the airbnb config, it seems like the current recommended barely utilizes the power of this awesome plugin. To make this plugin easier to digest for newer users, I would have found it beneficial if there was a small table that explained what each of these configs did. So I will start there, and work up from there !
@ljharb I would like to understand why
In practice it turns out to be a very bad idea for plugins to also provide configs, because of semver constraints
If this all sounds good, could you assign the issue to me ?
The reason the recommended config isn’t useful anymore is because adding anything to it would be a semver-major change.
You’re welcome to submit a PR; issue assignment isn’t significant :-)