ESLint v3.4.0 released

by Nicholas C. Zakas - 26 August 2016

We just pushed ESLint v3.4.0, which is a minor release upgrade of ESLint. This release adds a new feature and fixes several bugs found in the previous release.

Highlights

This is a summary of the major changes you need to know about for this version of ESLint.

Fix For Configuring Scoped Plugin Rules

We discovered a significant bug (#6362) when using scoped plugins. Scoped plugins use npm scopes such as @foo/eslint-plugin-bar. Due to a bug in ESLint, if you had a rule baz in the plugin @foo/eslint-plugin-bar, you would have to configure it without the scope, such as:

rules:
  bar/baz: error

This is problematic because it's possible that an unscoped plugin eslint-plugin-bar might exist and need to be configured in the same way.

Important: Starting in this release, you should now configure scoped plugin rules using the scope as a prefix. The previous example should now be written as:

rules:
  @foo/bar/baz: error

The other format will continue work until we release ESLint v4.0.0, at which point only the format using the package scope will work. We encourage you to update your configuration files as quickly as possible so as not to be caught up in the change for version 4.0.0.

Performance Improvements

We've been steadily improving the performance of traversing directories in ESLint. Previously, we made a change that dramatically improved the speed of directory traversal for those who weren't using .eslintignore (#5679). In this release, we've continued on to improve the speed for those using .eslintignore as well (#6710).

New Ways to Configure ECMAScript Version

ESLint has supported the ecmaVersion property for specifying which versions of ECMAScript syntax to enable. Prior to this release, you could use 3, 5, 6, and 7. However, the official ECMAScript standard is now being defined by year, so some new users found this confusing. As such, we've added the ability to use 2015 and 2016 in the ecmaVersion field (these correspond to 6 and 7, respectively), so that going forward we can use the more appropriate year-based values.

New Rules

The following new rules were added in this release:

Features

Enhancements

  • c210510 Update: add fixer for no-extra-parens (fixes #6944) (#6950) (not-an-aardvark)
  • d6fd064 Update: Add never option to multiline-ternary (fixes #6751) (#6905) (Kai Cataldo)
  • cf2242c Update: requireStringLiterals option for valid-typeof (fixes #6698) (#6923) (not-an-aardvark)
  • 1563808 Update: add support for ecmaVersion 20xx (fixes #6750) (#6907) (Kai Cataldo)

Bug Fixes

  • ca3d448 Fix: prefer-const false negative about eslintUsed (fixes #5837) (#6971) (Toru Nagashima)
  • 3e522be Fix: false negative of indent with else if statements (fixes #6956) (#6965) (not-an-aardvark)
  • 3c710c9 Fix: rename "AirBnB" => "Airbnb" init choice (fixes #6969) (Harrison Shoff)
  • 7660b39 Fix: object-curly-spacing for type annotations (fixes #6940) (#6945) (Toru Nagashima)
  • 3a1763c Fix: enable @scope/plugin/ruleId-style specifier (refs #6362) (#6939) (Toru Nagashima)
  • a063d4e Fix: no-cond-assign within a function expression (fixes #6908) (#6909) (Patrick McElhaney)
  • 8851ddd Fix: Improve pref of globbing by inheriting glob.GlobSync (fixes #6710) (#6783) (Kael Zhang)
  • 8561389 Fix: no-trailing-spaces wrong fixing (fixes #6933) (#6937) (Toru Nagashima)

Documentation

  • 1153955 Docs: Draft of JSCS migration guide (refs #5859) (#6942) (Nicholas C. Zakas)
  • 2dfb290 Docs: Distinguish examples in rules under Stylistic Issues part 7 (#6760) (Kenneth Williams)
  • 6a92be5 Docs: Update semantic versioning policy (#6935) (alberto)
  • d8b770c Docs: Change rule descriptions for consistent casing (#6915) (Brandon Mills)
  • 16db93a Build: Tag docs, publish release notes (fixes #6892) (#6934) (Nicholas C. Zakas)

Chores