[@typescript-eslint/no-unused-vars] how does this differ from no-unused-vars
?
#438
Labels
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
question
Questions! (i.e. not a bug / enhancment / documentation)
this module contains a rule called
@typescript-eslint/no-unused-variables
, and from a quick check it seems very similar to theno-unused-variable
rule from eslint-core. what is the difference between the two?the reason for my question is that i'm trying to combine the airbnb-rules with typescript-eslint and there are cases where it does not work. it was set up based on the official documentation ( https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage-with-airbnb ), and it seemed to work ok, but then i found out that for certain rules the airbnb-settings were ignored. for example, for
no-unused-vars
, the settingignoreRestSiblings
istrue
in airbnb-rules, but while programming i got linter-errors that suggested that the setting is set tofalse
somehow. so after some debugging i found out that typescript-eslint-recommended disables the originalno-unused-vars
rule, and enables the rule called@typescript-eslint/no-unused-vars
, which seems to be exactly the same as theno-unused-vars
rule. and because the settings for that rule are not the same in typescript-eslint as in airbnb-rules, problems happen.and now i wonder, why such rules are handled by typescript-eslint. i previously assumed this module only provides rules that are specific to typescript (and do not apply to javascript), and it is supposed to be used together with other eslint-plugins that cover other areas (accessibility etc.), but now i'm not sure. could someone explain the philosophy behind this module and how it should be used?
an idea: could this module provide a preset (similar to
-recommended
) that only deals with typescript-specific features?The text was updated successfully, but these errors were encountered: