Highlights
The following are the most important changes in this release.
The --fix-type option
This version introduces a new --fix-type
option for the command line interface. This option allows you to filter the type of fixes applied when using --fix
. You can specify the type of fixes to apply based on the new rule types we’ve assigned to each rule. The three rule types are:
problem
- the rule flags a potential problem with your code.suggestion
- the rule flags something that could be done in a better or preferred way.layout
- the rule flags changes limited to whitespace, semicolons, commas, or parentheses.
You might find this option useful if you’re using a source code formatter with ESLint, in which case you might want to use --fix-type problem,suggestion
to only apply fixes for rules that won’t clash with your formatter.
There is also a new fixTypes
option that can be passed to the CLIEngine
class that implements the same feature for those using the API.
Note: Fixes in custom rules will not be applied when using --fix-type
unless they include a meta.type
field. If you are maintaining a plugin with custom rules, please update your rules.
Features
Enhancements
- c832cd5 Update: add
ignoreDestructuring
option toid-match
rule (#10554) (一名宅。) - ae2b61d Update: “off” options for “space-before-blocks” (refs #10906) (#10907) (Sophie Kirschner)
- 79a2797 Update: no-restricted-imports to check re-export (fixes #9678) (#11064) (Nicholas C. Zakas)
- 802e926 Update: Warn for deprecation in Node output (fixes #7443) (#10953) (Colin Chang)
Bug Fixes
- 9436712 Fix: Unused recursive function expressions (fixes #10982) (#11032) (Sergei Startsev)
- 54687a8 Fix: prefer-const autofix multiline assignment (fixes #10582) (#10987) (Scott Stern)
- dcc6233 Fix: Ignore empty statements in no-unreachable (fixes #9081) (#11058) (Nicholas C. Zakas)
- 5525eb6 Fix: rule deprecation warnings did not consider all rules (#11044) (Teddy Katz)
Documentation
- 57f357e Docs: Update require-await docs with exception (fixes #9540) (#11063) (Nicholas C. Zakas)
- 3dd7493 Docs: update ecmaVersion to include 2019/10 values (#11059) (Vse Mozhet Byt)
- 4fe3287 Docs: Cross-reference two rules (refs #11041) (#11042) (Paul Melnikow)
- 44d37ca Docs: Update steps for adding new TSC member (#11038) (Nicholas C. Zakas)