ESLint v4.2.0 released
by Teddy Katz - 8 July 2017We just pushed ESLint v4.2.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.
Highlights
linter.verifyAndFix
can now accept a filter function for fixesWhen using the Node.js API to autofix code, it's sometimes undesirable to autofix every problem at once. For example, a user might want to avoid fixing problems reported by particular rule, or a tool might want to only fix one problem at a time. You can now pass an object like
{ fix: message => /* ... */ }
to the third argument oflinter.verifyAndFix
, or to theCLIEngine
constructor. If thefix
function returnstrue
, a fix is applied -- otherwise, a fix is not applied.eslint-nibble
uses this feature to autofix individual rules, or only autofix errors rather than warnings.Also see: documentation
The
getter-return
rule has been added.The
no-sync
rule now has a booleanallowAtRootLevel
option to allow sync function calls at the top level of a file.The
multiline-ternary
rule now has analways-multiline
option.
Features
- c693be5 New: Allow passing a function as
fix
option (fixes #8039) (#8730) (Ian VanSchooten) - 8698a92 New: getter-return rule (fixes #8449) (#8460) (薛定谔的猫)
Enhancements
- e0f0101 Update: fix indentation of nested function parameters (fixes #8892) (#8900) (Teddy Katz)
- 975dacf Update: fix indentation of EmptyStatements (fixes #8882) (#8885) (Teddy Katz)
- 3767cda Update: add no-sync option to allow at root level (fixes #7985) (#8859) (Victor Hom)
- 1f5bfc2 Update: Add always-multiline option to multiline-ternary (fixes #8770) (#8841) (Nathan Woltman)
- 676af9e Update: fix indentation of JSXExpressionContainer contents (fixes #8832) (#8850) (Teddy Katz)
- 85c9327 Update: fix parenthesized CallExpression indentation (fixes #8790) (#8802) (Teddy Katz)
- be8d354 Update: simplify variable declarator indent handling (fixes #8785) (#8801) (Teddy Katz)
Bug Fixes
- 11ffe6b Fix: no-regex-spaces rule incorrectly fixes quantified spaces (#8773) (Keri Warr)
- 931a9f1 Fix: indent false positive with multi-line await expression (#8837) (薛定谔的猫)
- f00854e Fix: --quiet no longer fixes warnings (fixes #8675) (#8858) (Kevin Partington)
- 22116f2 Fix: correct comma-dangle JSON schema (#8864) (Evgeny Poberezkin)
- 5c3ac8e Fix: arrow-parens fixer gets tripped up with trailing comma in args (#8838) (薛定谔的猫)
- 9417818 Fix: no-debugger autofixer produced invalid syntax (#8806) (Teddy Katz)
- eac06f2 Fix: no-extra-parens false positives for variables called "let" (#8808) (Teddy Katz)
- 616587f Fix: dot-notation autofix produces syntax errors for object called "let" (#8807) (Teddy Katz)
- a53ef7e Fix: don't require a third argument in linter.verifyAndFix (fixes #8805) (#8809) (Teddy Katz)
Documentation
- 7c8de92 Docs: Clarified PR guidelines in maintainer guide (#8876) (Kevin Partington)
- d1fc408 Docs: Update CLA link in Contributing docs (#8883) (Calvin Freitas)
- 1ce553d Docs: Fix wording of minProperties in object-curly-newline (fixes #8874) (#8878) (solmsted)
- 8796d55 Docs: add missing item to 4.0 migration guide table of contents (#8835) (薛定谔的猫)
- ce969f9 Docs: add guidelines for patch release communication (fixes #7277) (#8823) (Teddy Katz)
- 5c83c99 Docs: Clarify arrow function parens in no-extra-parens (fixes #8741) (#8822) (Kevin Partington)
- 84d921d Docs: Added note about Node/CJS scoping to no-redeclare (fixes #8814) (#8820) (Kevin Partington)
- 5ad8b70 Docs: add minor formatting improvement to paragraph about parsers (#8816) (Teddy Katz)
Build Related
- 88ed041 Build: Turnoff CI branch build (fixes #8804) (#8873) (Gyandeep Singh)
- c4f2e29 Build: fix race condition in demo (#8827) (Teddy Katz)
Chores
- 9f95a3e Chore: remove unused helper method from
indent
(#8901) (Teddy Katz) - 72f22eb Chore: replace is-my-json-valid with Ajv (#8852) (Gajus Kuizinas)
- b678535 Chore: Add collapsible block for config in ISSUE_TEMPLATE (#8872) (Gyandeep Singh)
- 330dd58 Chore: fix title of linter test suite (#8861) (Teddy Katz)
- 60099ed Chore: enable for-direction rule on ESLint codebase (#8853) (薛定谔的猫)
- e0d1a84 Chore: upgrade eslint-plugin-eslint-plugin & eslint-plugin-node (#8856) (薛定谔的猫)
- 0780d86 Chore: remove identical tests (#8851) (Teddy Katz)