tslint-consistent-codestyle
tslint-consistent-codestyle copied to clipboard
Collection of awesome rules to extend TSLint
We have a pre-commit hook that runs `tslint --fix`, but with a recent update of this plugin that does auto-fixing for `no-unnecessary-else`, it generates *really* strange code, most likely because...
Useless blocks * don't have a label * are contained in other block-like Nodes * excludes block as children of IterationStatement, IfStatement, WithStatement, TryStatement, ArrowFunction * maybe exclude blocks in...
> Enums that are exported or available in the global scope are ignored. In https://github.com/ajafff/tslint-consistent-codestyle/blob/master/docs/prefer-const-enum.md, not sure why this restriction is in place?
```ts const map: Map = new Map(); // could be rewritten as const map = new Map(); // but consider a scenario with type aliases type DisableMap = Map; const...
What do you think of adding a new selector to the naming-convention rule which applies to variables that are containing a construct signature? With the current selectors I cannot target...
```ts let foo: Array = [ ['a', true], ['b', false], ]; ```
Once typescript adds the ability to use literal typed constants as initializer in const enums, `prefer-const-enum` should try to handle this as well.
Should be easy to implement. Some things to consider: ```ts function f() { var a = foo(), b = bar(a, a); return b; } function f() { var a =...