ESLint v3.18.0 released

We just pushed ESLint v3.18.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 release adds support for AST selectors. AST selectors can describe syntax patterns very precisely, using a similar syntax to CSS selectors. Selectors can be used to:

  • simplify the implementation of custom rules.
  • disallow particular syntax patterns in a codebase using the no-restricted-syntax rule.

For example, suppose you want to disallow calls to Mocha’s xdescribe function in your codebase. Previously, it was not possible to do this without writing a custom rule. However, now you can configure the no-restricted-syntax rule with a selector:

{
  "rules": {
    "no-restricted-syntax": [
      "error",
      "CallExpression[callee.name='xdescribe']"
    ]
  }
}

Selectors can give you a lot of control over specific patterns in your code, without needing to write a custom rule for each pattern.

For more details, see the selector documentation.

Features

  • 1b678a6 New: allow rules to listen for AST selectors (fixes #5407) (#7833) (Teddy Katz)

Enhancements

Bug Fixes

Documentation

Dependency Upgrades

Chores

最新的 ESLint 新闻、案例研究、教程和资源。

ESLint v10.10.0 已发布
1 min read

ESLint v10.10.0 已发布

我们刚刚发布了 ESLint v10.10.0,这是 ESLint 的一次小版本升级。这个版本增加了一些新功能,并修复了上一版本中发现的几个错误。

ESLint v10.9.1 已发布
1 min read

ESLint v10.9.1 已发布

我们刚刚发布了 ESLint v10.9.1,这是 ESLint 的一个补丁版本升级。这个版本修复了前一个版本中发现的几个错误。

ESLint v10.9.0 已发布
1 min read

ESLint v10.9.0 已发布

我们刚刚发布了 ESLint v10.9.0,这是 ESLint 的一个小版本升级。这个版本增加了一些新功能,并修复了上一版本中发现的几个错误。