Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will add tslint to our setup and to the commit hook. However, as we already have prettier, this PR solely introduces some hand-picked semantic rules that prettier cannot cover:
prefer-const
: This replaceslet
withconst
if possible.const
is usually slightly faster in V8ordered-imports
: Probably the biggest diff. Imports are sorted so that similar imports are next to each other and removing and re-adding an import will put it in the same position.arrow-return-shorthand
: Replaces()=>{return 1}
with()=>1
.no-string-literal
: Replacesx['y']
withx.y
which should be better optimizedobject-literal-shorthand
: Replaces{x: x}
with{x}
no-unnecessary-type-assertion
: Removes all unnecessary TS type casts!interface-over-type-literal
: Replaces types with interfaces (which are e.g. extensible) wherever possibleAll of these rules have automatic fixers and are applied automatically on commit. I have put the application of the rules into a separate commit that can be easily undone so that we can remove/add rules.