ESLint v3.16.0 released

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

Highlights

This is a summary of some of the notable changes in this version of ESLint.

Updated Token Iterator Methods

This release includes an exciting update for rule authors! Many of the token iterator methods provided by sourceCode have been updated with a new options parameter. Some highlights:

includeComments

Many of these methods can now include comments in the returned results using the { includeComments: true } option. The following methods are now deprecated:

Instead, please use the following, respectively:

filter

The filter option is a function that will filter the returned tokens. This allows for finding a specific token by type or value without having to create a loop.

For instance, the following:

let token = sourceCode.getTokenAfter(node);   

while (token.type !== "Keyword") {    
    token = sourceCode.getTokenAfter(token);    
}   

can now be written as:

const token = sourceCode.getTokenAfter(node, { filter: token => token.type === "Keyword" });

The update includes other options as well! For more details, please read the updated documentation.

Performance Improvements

Performance improvements were made to both the initial processing of source code as well as to autofixing.

Autofixing

Autofix support was added to one rule:

Enhancements

Bug Fixes

Documentation

Dependency Upgrades

Chores