Rules

Rules in ESLint are divided into several categories to help you better understand their value. All rules are disabled by default. ESLint recommends some rules to catch common problems, and you can use these recommended rules by including extends: "eslint:recommended" in your configuration file. The rules that will be enabled when you inherit from eslint:recommended are indicated below as “”. For more information on how to configure rules and use extends, please see the configuration documentation.

Some rules are fixable using the --fix command line flag. Those rules are marked as “” below.

Possible Errors

The following rules point out areas where you might have made mistakes.

Best Practices

These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.

Strict Mode

These rules relate to using strict mode and strict mode directives.

Variables

These rules have to do with variable declarations.

Node.js and CommonJS

These rules are specific to JavaScript running on Node.js or using CommonJS in the browser.

Stylistic Issues

These rules are purely matters of style and are quite subjective.

ECMAScript 6

These rules are only relevant to ES6 environments.

Removed

These rules existed in a previous version of ESLint but have since been replaced by newer rules.