You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem
Current behavior
For now there is no specific ts-lint rule for type assertion.
This means both of these are valid:
const circle: Circle = shape as Circle
const circle: Circle = <Circle> shape;
Expected behavior
To increase consistency the rule "no-angle-bracket-type-assertion" should be enabled in /packages/stark-build/config/tslint.json to enforce the first way of type assertion. Or the other option can be chosen, but there no is rule available yet. (palantir/tslint#1228)
christophercr
changed the title
Add "Rule: no-angle-bracket-type-assertion" to tslint
linting: add rule "no-angle-bracket-type-assertion" to TSLint config
Jan 10, 2019
christophercr
changed the title
linting: add rule "no-angle-bracket-type-assertion" to TSLint config
build: add rule "no-angle-bracket-type-assertion" to TSLint config
Jan 10, 2019
SuperITMan
changed the title
build: add rule "no-angle-bracket-type-assertion" to TSLint config
tslint: add rule "no-angle-bracket-type-assertion" to TSLint config
Jun 6, 2019
SuperITMan
changed the title
tslint: add rule "no-angle-bracket-type-assertion" to TSLint config
tslint: add rule "no-angle-bracket-type-assertion"
Jun 6, 2019
I'm submitting a...
Current behavior
For now there is no specific ts-lint rule for type assertion.
This means both of these are valid:
const circle: Circle = shape as Circle
const circle: Circle = <Circle> shape;
Expected behavior
To increase consistency the rule "no-angle-bracket-type-assertion" should be enabled in
/packages/stark-build/config/tslint.json
to enforce the first way of type assertion.Or the other option can be chosen, but there no is rule available yet. (palantir/tslint#1228)
It is a choice between the two ways, but using
as
has a slight preference. (Because of compatibility with JSX).TypeScript documentation
TSLint documentation
Minimal reproduction of the problem with instructions
const circle: Circle = shape as Circle; // Passes
const circle: Circle = <Circle> shape; // Passes
What is the motivation / use case for changing the behavior?
Increasing consistency in the source code.
Environment
The text was updated successfully, but these errors were encountered: