Note: This is the last scheduled release prior to v2.0.0. In the coming weeks, we will be focusing specifically on v2.0.0 and will be regularly releasing alpha versions for testing. These alpha versions are not suitable for use in a production environment and are provided primarily for getting early feedback.
Highlights
Here are some highlights of changes in this release.
Configuration File Formats
v1.10.0 introduces the ability to use configuration files in different formats. Instead of the regular .eslintrc
file, you can use a JavaScript (.eslintrc.js
), a YAML file (.eslintrc.yml
or .eslintrc.yaml
), or a JSON file (.eslintrc.json
). We are formally deprecating use of the .eslintrc
extensionless configuration file format in favor the format-specific versions. Don’t worry, we’ll still support .eslintrc
files for a long time, but we’d like to encourage everyone to move to the new file formats as you’ll get advantages such as syntax highlighting and error detection with many editors. Read more in the documentation.
Improvements to --init
The --init
command, which is used to bootstrap a configuration file, now has an additional option: use a popular style guide. When running --init
, you can still choose to answer the questionnaire we’ve always had, or you can choose to use the Google, Airbnb, or Standard style guides. The correct shareable config will automatically be installed in your project when using one of these style guides. We will look to add more popular style guides as the shareable configs become available.
Additionally, --init
will now create a configuration file in one of the new formats. It will ask you which format you prefer and will generate the file in that format.
Disabling Inline Configurations
The new --no-inline-config
command makes ESLint skip all inline configuration comments (such as /*eslint semi:2*/
) so that you can only configure ESLint uses the command line and configuration files.
Features
- New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson)
- New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas)
Enhancements
- Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas)
- Update: Add class support to
require-jsdoc
rule (fixes #4268) (Gyandeep Singh) - Update: return type error in
valid-jsdoc
rule (fixes #4443) (Gyandeep Singh) - Update: Display errors at the place where fix should go (fixes #4470) (nightwing)
- Update: Accept array for
ignorePattern
(fixes #3982) (Jesse McCarthy) - Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko)
- Update: Allow empty arrow body (fixes #4411) (alberto)
- Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas)
- Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson)
- Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko)
Bug Fixes
- Fix: Handle comments in block-spacing (fixes #4387) (alberto)
- Fix: space-before-keywords false positive (fixes #4449) (alberto)
- Fix: Improves performance (refs #3530) (Toru Nagashima)
- Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing)
- Fix:
no-extend-native
crashed at empty defineProperty (fixes #4438) (Toru Nagashima) - Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto)
- Fix:
curly
warns wrong location forelse
(fixes #4362) (Toru Nagashima) - Fix:
id-length
properties never option (fixes #4347) (Toru Nagashima) - Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington)
- Fix: Handle comments in comma-spacing (fixes #4389) (alberto)
- Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas)
- Fix: Add the missing “as-needed” docs to the radix rule (fixes #4364) (Michał Gołębiowski)
- Fix: Display singular/plural version of “line” in message (fixes #4359) (Marius Schulz)
- Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington)
Documentation
- Docs: Remove dupes from changelog (Nicholas C. Zakas)
- Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas)
- Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas)
- Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas)
- Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas)
- Docs: Fix typo in default
cacheLocation
value (Andrew Hutchings) - Docs: Update indent.md (Nathan Brown)
- Docs: Replace link to deprecated rule with newer rule (Andrew Marshall)
- Docs: missing close rbracket in example (@storkme)
- Docs: Document semi-spacing behaviour (fixes #4404) (alberto)