(Alpha) JavaScript and TypeScript Rules
This release adds many new JavaScript and TypeScript rules using Sourcery’s (alpha-stage) multi-language functionality.
If you are interested in getting access to the Beta for Sourcery for JavaScript and Typescript, please sign up here.
Full Changelog
Added
- Docs: How To Use Sourcery For Code Reviews?
- Handle skip comments in JavaScript
no-eval
JavaScript ruleremove-redundant-boolean
JavaScript ruleuse-braces
JavaScript ruledont-negate-is-instanceof-operands
JavaScript ruleremove-unreachable-code
JavaScript rulemisplaced-break-or-continue
JavaScript ruledont-shadow-arguments
JavaScript ruleremove-redundant-if-statement
JavaScript ruledont-reassign-parameters
JavaScript ruleinline-immediately-returned-variable
JavaScript ruleavoid-function-declarations-in-blocks
JavaScript rule- Some refactorings like
simplify-boolean-comparison
will now trigger in match-case guard clauses possible-incorrect-bitwise-operator
JavaScript ruledont-self-assign-variables
JavaScript rulegenerators-should-yield
JavaScript rulethrow-new-errors
JavaScript ruleremove-redundant-slice-index
JavaScript ruleonly-delete-object-properties
JavaScript ruledont-use-with
JavaScript ruledont-concatenate-string-literals
JavaScript ruleno-new-symbol
JavaScript rulereturn-outside-function
JavaScript ruleyield-outside-generator
JavaScript ruleavoid-infinite-loops
JavaScript rule
Changed
- Only show a maximum of 3 lines of code for comments in the CLI for Javascript rules
- Extended
use-array-literal
to handle arguments use-object-destructuring
andcombine-object-destructure
extended to also work forlet
statements- Added hover for JavaScript diagnostics
Fixed
- issue with replacement of subsequent indented new lines in JavaScript
- issue where JavaScript comments showed code actions that did nothing
- issue with partially-applied
use-braces
refactoring remove-dict-keys
no longer proposed when the target has multiple values- Correctly report number of scanned files even if they have no issues
merge_assign_and_aug_assign
can no longer incorrectly lead to access to a variable not assigned yet- Prevent
dict-literal
,list-literal
andremove-unnecessary-cast
from incorrectly triggering in match-case patterns