Migrating to v1.0.0

ESLint v1.0.0 is the first major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading.

All Rules Off by Default

The most important difference in v1.0.0 is that all rules are off by default. We made this change after numerous requests to allow turning off the default rules from within configuration files. While that wasn’t technically feasible, it was feasible to have all rules off by default and then re-enable rules in configuration files using extends. As such, we’ve made the --reset behavior the default and removed this command line option.

When using --init, your configuration file will automatically include the following line:

{"extends":"eslint:recommended"}

This setting mimics some of the default behavior from 0.x, but not all. If you don’t want to use any of the recommended rules, you can delete this line.

To address: If you are currently using --reset, then you should stop passing --reset on the command line; no other changes are necessary. If you are not using --reset, then you should review your configuration to determine which rules should be on by default. You can partially restore some of the default behavior by adding the following to your configuration file:

The "eslint:recommended" configuration contains many of the same default rule settings from 0.x, but not all. These rules are no longer on by default, so you should review your settings to ensure they are still as you expect:

To address: You’ll need to update your rule configurations to use the new rules. ESLint v1.0.0 will also warn you when you’re using a rule that has been removed and will suggest the replacement rules. Hopefully, this will result in few surprises during the upgrade process.

Column Numbers are 1-based

From the beginning, ESLint has reported errors using 0-based columns because that’s what Esprima, and later Espree, reported. However, most tools and editors use 1-based columns, which made for some tricky integrations with ESLint. In v1.0.0, we’ve switched over to reporting errors using 1-based columns to fall into line with the tools developers use everyday.

To address: If you’ve created an editor integration, or a tool that had to correct the column number, you’ll need to update to just pass through the column number from ESLint. Otherwise, no change is necessary.

No Longer Exporting cli

In 0.x, the cli object was exported for use by external tools. It was later deprecated in favor of CLIEngine. In v1.0.0, we are no longer exporting cli as it should not be used by external tools. This will break existing tools that make use of it.

To address: If you are using the exported cli object, switch to using CLIEngine 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.

The replacement for eslint-tester is called RuleTester. It’s a simplified version of ESLintTester that’s designed to work with any testing framework. This object is exposed by the package.

To address: Convert all of your rule tests to use RuleTester. If you have this as a test using ESLintTester: