ESLint 1.0.0-rc-2 released

We just pushed ESLint 1.0.0-rc-2, which is the second release candidate for 1.0.0. As such, we have duplicated some of the content from the 1.0.0-rc-1 announcement to make it easier to understand the differences between 0.24.1 and this version.

Note: This version of ESLint is not ready for production use and is provided to gather feedback from the community before releasing the final version. Please let us know if you having any problems or feedback by creating issues.

Highlights

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

Installing

Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the next tag when installing:

npm i eslint@next --save-dev

You can also specify the version directly:

npm i eslint@1.0.0-rc-2 --save-dev

Migration Guide

As there are a lot of changes, we’ve created a migration guide describing the changes in great detail along with the steps you should take to address them. Not all ESLint users will be affected by the changes, however, the changes are big enough that we recommend everyone read the migration thoroughly.

New Language Features

1.0.0-rc-2 has been upgraded to the latest version of Espree, which means you now have access to additional language features:

  1. newTarget allows you to use new.target in your code.
  2. experimentalObjectRestSpread allows you to use the experimental object rest/spread in your code.

As special note about object rest/spread: We added this as a result of feedback that this was the only feature missing from ESLint that made many React users switch to babel-eslint. We thought it was silly to require React users to load an entirely separate parser for a single language feature, and since it kept being requested, we decided to add it. Keep in mind that this feature is still experimental and as such, the node types reflect that:

These are non-standard nodes and may change at any time. We therefore recommend that you don’t create rules that used these directly unless you are willing to have those rules break when/if these nodes are standardized.

Keep in mind that this does not mean we will start supporting all experimental features, but we will continue evaluate them on a case-by-case basis.

–reset is now the default

The --reset behavior is now the default behavior for ESLint and the --reset flag has been removed. This means there are no rules on by default in ESLint; you must enable the rules that you want. For more information on this change and how it affects you, please see the migration guide.

Missing rules handled safely

In previous version, a missing rule would immediately cause ESLint to crash and exit. In this version, ESLint will just warn you about the missing rule, and if the rule has been replaced by something else, will tell you what rule to use instead.

Deprecating eslint-tester

The eslint-tester module, which has long been the primary tester for ESLint rules, has now been moved into the eslint module. This was the result of a difficult relationship between these two modules that created circular dependencies and was causing a lot of problems in rule tests. Moving the tester into the eslint module fixed a lot of those issues.

To address: Update any references to require("eslint-tester") to this:

var ESLintTester = require("eslint").ESLintTester;

New Rules

There are several new rules for this release:

Breaking Changes (1.0.0-rc-1)

Features (1.0.0-rc-2)

Features (1.0.0-rc-1)

Enhancements (1.0.0-rc-2)

Enhancements (1.0.0-rc-1)

Bug Fixes (1.0.0-rc-2)

Bug Fixes (1.0.0-rc-1)

Documentation (1.0.0-rc-2)

Documentation (1.0.0-rc-1)

Dependency Upgrades (1.0.0-rc-1)