This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Warning Displayed For Supported no-unused-variable
Rule
#3219
Labels
Milestone
Comments
To me, the no-unused-variable simply does not do anything ;( This is my config {
"extends": [
"tslint:latest",
"tslint-react",
"tslint-config-prettier"
],
"rules": {
"ban-types": false,
"interface-name": null,
"interface-over-type-literal": false,
"jsx-boolean-value": null,
"jsx-no-lambda": null,
"max-classes-per-file": [],
"member-access": false,
"no-namespace": null,
"no-unused-expression": [false],
"no-unused-variable": true,
"no-var-requires": false,
"object-literal-shorthand": false,
"object-literal-sort-keys": false,
"only-arrow-functions": null,
"ordered-imports": null,
"prefer-const": false,
"variable-name": false,
"no-invalid-template-strings": false,
"no-submodule-imports": false
}
} |
@destroyerofbuilds that sounds like a good point -- you're using |
@tomitrescak how are you running TSLint? That sounds like a separate issue from the original post; I would encourage you to open another issue if you haven't already. |
ghost
mentioned this issue
Sep 14, 2017
adidahiya
pushed a commit
that referenced
this issue
Sep 20, 2017
Remove warning printed to console when a user of `tslint` is using the `no-unused-variable` rule while also using the TypeScript compiler with the `noUnusedLocals` and `noUnusedParameters` options set. While it's not technically necessary to use the `noUnusedVariableRule` rule with the TypeScript compiler options set, using this rule is still useful when using the `--fix` option in `tslint` to automatically remove unused variables. Fixes #3219
HyphnKnight
pushed a commit
to HyphnKnight/tslint
that referenced
this issue
Apr 9, 2018
Remove warning printed to console when a user of `tslint` is using the `no-unused-variable` rule while also using the TypeScript compiler with the `noUnusedLocals` and `noUnusedParameters` options set. While it's not technically necessary to use the `noUnusedVariableRule` rule with the TypeScript compiler options set, using this rule is still useful when using the `--fix` option in `tslint` to automatically remove unused variables. Fixes palantir#3219
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug Report
Actual behavior
I'm running
tslint
over an existing code base.My project has the
no-unused-variable
rule set (through the use of a preset-like package).My project also has the
noUnusedLocals
andnoUnusedParameters
compiler options enabled for TypeScript (against, through the use of a preset-like package).I occasionally update my rules and run
tslint
's--fix
option to auto-fix my code.That includes benefiting from the auto-fix feature of the
no-unused-variable
rule.Example output when running
tslint --fix
on my code base:Expected behavior
As noted here the
no-unused-variable
rule was un-deprecated because users (including myself) benefit from the auto-fix feature.However the warning implies that I shouldn't be using the rule at all, and causes a lot of unnecessary output to the console, which may obscure other important information such as un-fixable problems in the code.
I believe it would be alright removing the warning.
The text was updated successfully, but these errors were encountered: