-
Notifications
You must be signed in to change notification settings - Fork 889
fix(noUnusedVariableRule): remove warning #3227
Conversation
Thanks for your interest in palantir/tslint, @destroyerofbuilds! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
src/rules/noUnusedVariableRule.ts
Outdated
@@ -30,6 +30,10 @@ export class Rule extends Lint.Rules.TypedRule { | |||
description: Lint.Utils.dedent`Disallows unused imports, variables, functions and | |||
private class members. Similar to tsc's --noUnusedParameters and --noUnusedLocals | |||
options, but does not interrupt code compilation.`, | |||
descriptionDetails: Lint.Utils.dedent`If addition to avoiding compilation errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In addition ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you can add a newline + indentation before "If"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed if
, and moved the start of the sentence to a newline.
src/rules/noUnusedVariableRule.ts
Outdated
descriptionDetails: Lint.Utils.dedent`If addition to avoiding compilation errors, | ||
this rule may still be useful if you wish to have \`tslint\` automatically | ||
remove unused imports, variables, functions, and private class members, when | ||
using \`tslint\`'s \`--fix\` option.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"... TSLint's `--fix` option."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed TSLint name.
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
I'm waiting on approval to sign the CLA. In the meantime, please keep in mind that (And that I am not a lawyer): Many of the provisions of the Palantir CLA are covered by the Apache license itself. Please see the Lowering the Barriers to Participation section of https://blog.openshift.com/keep-calm-and-merge-on-lowering-barriers-to-open-source-contributions-with-apache-v2/. |
I've been approved to sign the CLA. I'm not sure why my modification has caused several of the tests to fail. The output messages aren't even related to this change. Is there anything I can do to correct the issue? |
The CI failures are not related to your changes. |
CI should be fixed when this lands on master. |
thanks @destroyerofbuilds! |
Really look forward to this in the next release -- thank you We set rules like |
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
Remove warning printed to console when a user of
tslint
is using theno-unused-variable
rule while also using the TypeScript compilerwith the
noUnusedLocals
andnoUnusedParameters
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 intslint
toautomatically remove unused variables.
Fixes #3219