Is your feature request that we implement a new rule?
No
Is your feature request related to a problem? Please describe.
There are some deprecated web features which enjoy broad browser support, will continue to be supported for the foreseeable future, and have alternatives that cannot be quickly put into practice or are not workable. For example, event.which and event.keyCode are deprecated but certain libraries can only work with them, and event.code and event.key are either not broadly supported or not always direct replacements.
Describe the solution you'd like
I would like to designate certain values as exceptions, perhaps as a list of regular expressions, to avoid triggering the deprecation rule throughout my project.
Describe alternatives you've considered
// tslint:disable-next-line:deprecation throughout the codeAdditional context
There are other properties I would like to turn this on for, such as performance.timing, and occasionally certain private APIs written by other teams at my org.
Another point: This would be useful in cases where a team is working on updating old legacy codebases. It would be useful to mark all old functions/classes/etc as deprecated to prevent them from being inadvertently used in new code, while ignoring cases where they are being used within the legacy code.
Any news on this?
@SDohle nothing yet - any progress will always be posted or linked to here. Waiting on someone to put forward a working proposal on how this could be added to the rule's options.
Till that's implemented in TSLint directly, you could use TSLint-Filter to suppress specific warnings:
https://www.npmjs.com/package/tslint-filter
Simply install the package, add
"extends": ["tslint-filter"]
to your tslint.json, and then you can use
"___deprecation": [true, [
"^KeyboardEvent\\.which"
]],
to filter the warnings.
โ ๏ธ TSLint's time has come! โ ๏ธ
TSLint is no longer accepting most feature requests per #4534. See typescript-eslint.io for the new, shiny way to lint your TypeScript code with ESLint. โจ
It was a pleasure open sourcing with you all!
๐ค Beep boop! ๐ TSLint is deprecated ๐ _(#4534)_ and you should switch to typescript-eslint! ๐ค
๐ This issue is being locked to prevent further unnecessary discussions. Thank you! ๐
Most helpful comment
Till that's implemented in TSLint directly, you could use TSLint-Filter to suppress specific warnings:
https://www.npmjs.com/package/tslint-filter
Simply install the package, add
to your
tslint.json, and then you can useto filter the warnings.