Package Exports
- tslint-override
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslint-override) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TSLint override rule
Finally brings support for the override keyword to TypeScript!
Why
Most modern object oriented languages provide an override keyword to prevent misuse of the override mechanism. However, support for the override keyword in typescript is nowhere in sight, and in the meantime, TypeScript programmers are left with no ideal solution to this problem.
Here are some reasons to use this rule:
- You may want to override a method, but introduce a typo in the method name and end up creating a new method by accident.
- You accidentally override a method of a base class because the method you just added shares the same name and has a compatible signature.
- A library author introduces a new method to a base class, which gets accidentally overridden by a method you wrote in a subclass in the past.
How
npm install --save-dev tslint-overrideThen extend the tslint-override configuration (note that you can extend multiple configs if you need to).
{
"extends": [
"tslint-override"
]
}This rule requires type information, which means that errors will not show in VSCode (see vscode-tslint#70 ). It will work out of the box when running tslint however.
What
TODO: Extract example from test cases
Contributing, Credits, etc
Author: Hadrien Milano <github.com/hmil>
License: MIT
Please star this repo if you like it, and submit code and issues if something doesn't work.