-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Recommended settings set sourceType to module #118
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
Comments
When we put the recommended config up for debate we erred on the side of what's the most common / correct use case - creating minimal config for the majority with overrides for the minority. The majority use case is for TBH it's the first time that I have seen a case that doesn't work with It's certainly up for discussion though! |
We could also export multiple configs that are "recommended", one for scripts and one for modules (or just one with the module override and one without). As it is, having one recommended config be opinionated feels a little weird (to me). |
What's recommended is always going to be subjective to some degree 😄 The recommended ruleset we eventually landed on was based on two things:
bradzacher/eslint-plugin-typescript#144 Definitely not opposed to exporting more configs though. |
Hi, thanks for the responses. yes, this is definitely subjective. My point of view is that I thought of the recommended settings as a parallel to the recommended settings from eslint itself - just a set of rules to be enabled, that most people would agree are useful, with some of the more obscure onea left out. Therefore, I was also surprised that it set the parser, but that's obviously useful for everyone using the plugin. Anyway, I think it is without question that if it is left this way, it should be documented somewhere (maybe it is and I'm just blind...) |
you're not blind - It's not documented because it's a rare case that hasn't been considered before. |
The
plugin:@typescript-eslint/recommended
config setsMight I ask why override the eslint default? I've stumbled upon this while trying to find out why
no-unused-vars
was throwing false positives for functions exported with/* exported fnName */
- given this override in the recommended config, it makes sense of course, but I had to go through all the settings to find out why it works fine if I enable only the rule and throws false positives if I extend the whole recommended config...I get that modules are The Right Way™ now, but not everybody uses them - overriding the eslint default seems like a poor choice to me, because it silently changes the behaviour of eslint without the user knowing why if they don't actually go into the recommended config file.
Versions
@typescript-eslint/eslint-plugin
1.0.0
@typescript-eslint/parser
1.0.0
TypeScript
3.2.4
ESLint
5.12.1
node
11.7.0
npm
6.6.0
The text was updated successfully, but these errors were encountered: