Published under: Release Notes
1 min read
Highlights
Two new rules were added:
Two new methods were added to the SourceCode
API for rules:
Two enhancements were made to the RuleTester
utility:
- Error message assertions can now be regular expressions.
output
for a test case can be set tonull
to assert that the case is not autofixed.
Features
- dad20ad New: add SourceCode#getLocFromIndex and #getIndexFromLoc (fixes #8073) (#8158) (Teddy Katz)
- 20daea5 New: no-compare-neg-zero rule (#8091) (薛定谔的猫)
- 287e882 New: nonblock-statement-body-position rule (fixes #6067) (#8108) (Teddy Katz)
- 7ff42e8 New: Allow regexes in RuleTester (fixes #7837) (#8115) (Daniel Lo Nigro)
Enhancements
- 4fdf6d7 Update: deprecate
applyDefaultPatterns
inline-comment-position
(#8183) (alberto) - bf4d8cf Update: ignore eslint comments in lines-arount-comment (fixes #4345) (#8155) (alberto)
- 18a519f Update: let RuleTester cases assert that no autofix occurs (fixes #8157) (#8163) (Teddy Katz)
- ca1694b Update: ignore negative ranges in fixes (#8133) (alberto)
- da8e8af Update: include function name in report message if possible (fixes #7260) (#8058) (Dieter Luypaert)
Bug Fixes
- 25e5817 Fix: Don’t autofix
+ +a
to++a
in space-unary-ops (#8176) (Alan Pierce) - d02bd11 Fix: padded-blocks autofix problems with comments (#8149) (alberto)
- 4d35a81 Fix: Add a utility to avoid autofix conflicts (fixes #7928, fixes #8026) (#8067) (Alan Pierce)
- 1ee5c27 Fix: Make RuleTester handle empty-string cases gracefully (fixes #8142) (#8143) (Teddy Katz)
- 4e52cfc Fix: Improve keyword-spacing typescript support (fixes #8110) (#8111) (Reyad Attiyat)
- 8f91e32 Fix:
ignoreRestSiblings
option didn’t cover arguments (fixes #8119) (#8120) (Toru Nagashima)
Documentation
- a30eb8d Docs: improve documentation for RuleTester cases (#8162) (Teddy Katz)
- 9994889 Docs: Add missing space to
create
inno-use-before-define
(#8166) (Justin Anastos) - 4d542ba Docs: Remove unneeded statement about autofix (#8164) (alberto)
- 163d751 Docs:
lines-around-comment
doesn’t disallow empty lines (#8151) (alberto) - 044bc10 Docs: Add details about “–fix” option for “sort-imports” rule (#8077) (Olivier Audard)
Build Related
- a6ce8f9 Build: Sort rules before dumping them to doc files (#8154) (Danny Andrews)
- cbd7ded Build: display rules’ meta data in their docs (fixes #5774) (#8127) (Wilson Kurniawan)