ESLint is designed to be flexible and configurable for your use case. You can turn off every rule and run only with basic syntax validation or mix and match the bundled rules and your custom rules to fit the needs of your project. There are two primary ways to configure ESLint:
.eslintrc.*file or an
eslintConfigfield in a
package.jsonfile, both of which ESLint will look for and read automatically, or you can specify a configuration file on the command line.
Here are some of the options that you can configure in ESLint:
- Environments - which environments your script is designed to run in. Each environment brings with it a certain set of predefined global variables.
- Globals - the additional global variables your script accesses during execution.
- Rules - which rules are enabled and at what error level.
- Plugins - which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
All of these options give you fine-grained control over how ESLint treats your code.
Table of Contents
- Configuration File Formats
- Using Configuration Files
- Adding Shared Settings
- Cascading and Hierarchy
- Extending Configuration Files
- Configuration Based on Glob Patterns
- Personal Configuration Files