You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/extend/ways-to-extend.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ This page explains the ways to extend ESLint, and how these extensions all fit t
15
15
16
16
Plugins let you add your own ESLint custom rules and custom processors to a project. You can publish a plugin as an npm module.
17
17
18
-
Plugins are useful because your project may require some ESLint configuration that isn't included in the core `eslint` package. For example, if you're using a frontend JavaScript library like React or framework like Vue, these tools have some features that require custom rules outside the scope of the ESLint core rules.
18
+
Plugins are useful because your project may require some ESLint configuration that isn't included in the core `eslint` package. For example, if you're using a frontend JavaScript library like [React](https://react.dev/) or framework like [Vue](https://vuejs.org/), these tools have some features that require custom rules outside the scope of the ESLint core rules.
19
19
20
20
Often a plugin is paired with a configuration for ESLint that applies a set of features from the plugin to a project. You can include configurations in a plugin as well.
21
21
@@ -35,15 +35,15 @@ ESLint shareable configs are pre-defined configurations for ESLint that you can
35
35
36
36
You can either publish a shareable config independently or as part of a plugin.
37
37
38
-
For example, a popular shareable config is [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb), which contains a variety of rules in addition to some [parser options](../use/configure/language-options#specifying-parser-options). This is a set of rules for ESLint that is designed to match the style guide used by the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript). By using the `eslint-config-airbnb` shareable config, you can automatically enforce the Airbnb style guide in your project without having to manually configure each rule.
38
+
For example, a popular shareable config is [`eslint-config-airbnb`](https://www.npmjs.com/package/eslint-config-airbnb), which contains a variety of rules in addition to some [parser options](../use/configure/language-options#specifying-parser-options). This is a set of rules for ESLint that is designed to match the style guide used by the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript). By using the `eslint-config-airbnb` shareable config, you can automatically enforce the Airbnb style guide in your project without having to manually configure each rule.
39
39
40
-
To learn more about creating a shareable config, refer to [Share Configuration](shareable-configs).
40
+
To learn more about creating a shareable config, refer to [Share Configurations](shareable-configs).
41
41
42
42
## Custom Formatters
43
43
44
44
Custom formatters take ESLint linting results and output the results in a format that you define. Custom formatters let you display linting results in a format that best fits your needs, whether that's in a specific file format, a certain display style, or a format optimized for a particular tool. You only need to create a custom formatter if the [built-in formatters](../use/formatters/) don't serve your use case.
45
45
46
-
For example, the custom formatter [eslint-formatter-gitlab](https://www.npmjs.com/package/eslint-formatter-gitlab) can be used to display ESLint results in GitLab code quality reports.
46
+
For example, the custom formatter [eslint-formatter-gitlab](https://www.npmjs.com/package/eslint-formatter-gitlab) can be used to display ESLint results in [GitLab](https://about.gitlab.com/) code quality reports.
47
47
48
48
To learn more about creating a custom formatter, refer to [Custom Formatters](custom-formatters).
Copy file name to clipboardExpand all lines: docs/src/integrate/nodejs-api.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ While ESLint is designed to be run on the command line, it's possible to use ESL
15
15
16
16
The `ESLint` class is the primary class to use in Node.js applications.
17
17
18
-
This class depends on the Node.js `fs` module and the file system, so you cannot use it in browsers. If you want to lint code on browsers, use the [Linter](#linter) class instead.
18
+
This class depends on the Node.js [`fs`](https://nodejs.org/api/fs.html) module and the file system, so you cannot use it in browsers. If you want to lint code on browsers, use the [`Linter`](#linter) class instead.
19
19
20
20
Here's a simple example of using the `ESLint` class:
Copy file name to clipboardExpand all lines: docs/src/pages/flags.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ The `ESLint` class also reads the `ESLINT_FLAGS` environment variable to set fla
114
114
115
115
### Enable Feature Flags in VS Code
116
116
117
-
To enable flags in the VS Code ESLint Extension for the editor, specify the flags you'd like in the `eslint.options` setting in your `settings.json` file:
117
+
To enable flags in the VS Code ESLint Extension for the editor, specify the flags you'd like in the `eslint.options` setting in your [`settings.json`](https://code.visualstudio.com/docs/configure/settings#_settings-json-file) file:
Copy file name to clipboardExpand all lines: docs/src/use/command-line-interface.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The ESLint Command Line Interface (CLI) lets you execute linting from the termin
14
14
15
15
## Run the CLI
16
16
17
-
ESLint requires Node.js for installation. Follow the instructions in the [Getting Started Guide](getting-started) to install ESLint.
17
+
ESLint requires [Node.js](https://nodejs.org/) for installation. Follow the instructions in the [Getting Started Guide](getting-started) to install ESLint.
18
18
19
19
Most users use [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) to run ESLint on the command line like this:
20
20
@@ -193,7 +193,7 @@ This example uses the configuration file at `~/my.eslint.config.js`, which is us
193
193
194
194
#### `--inspect-config`
195
195
196
-
**Flat Config Mode Only.** This option runs `npx @eslint/config-inspector@latest` to start the config inspector. You can use the config inspector to better understand what your configuration is doing and which files it applies to. When you use this flag, the CLI does not perform linting.
196
+
**Flat Config Mode Only.** This option runs `npx @eslint/config-inspector@latest` to start the [config inspector](https://github.com/eslint/config-inspector). You can use the config inspector to better understand what your configuration is doing and which files it applies to. When you use this flag, the CLI does not perform linting.
197
197
198
198
-**Argument Type**: No argument.
199
199
@@ -839,7 +839,7 @@ Strategy for the cache to use for detecting changed files.
839
839
-**Multiple Arguments**: No
840
840
-**Default Value**: `metadata`
841
841
842
-
The `content` strategy can be useful in cases where the modification time of your files changes even if their contents have not. For example, this can happen during git operations like `git clone` because git does not track file modification time.
842
+
The `content` strategy can be useful in cases where the modification time of your files changes even if their contents have not. For example, this can happen during git operations like [`git clone`](https://git-scm.com/docs/git-clone) because git does not track file modification time.
843
843
844
844
##### `--cache-strategy` example
845
845
@@ -922,7 +922,7 @@ Ignore unused suppressions. By default, ESLint exits with exit code `2` and disp
922
922
923
923
#### `--init`
924
924
925
-
This option runs `npm init @eslint/config` to start the config initialization wizard. It's designed to help new users quickly create an `.eslintrc` file by answering a few questions. When you use this flag, the CLI does not perform linting.
925
+
This option runs `npm init @eslint/config` to start the config initialization wizard. It's designed to help new users quickly create an `eslint.config.js` file by answering a few questions. When you use this flag, the CLI does not perform linting.
926
926
927
927
-**Argument Type**: No argument.
928
928
@@ -1105,5 +1105,5 @@ This option starts the ESLint MCP server for use with AI agents.
1105
1105
When linting files, ESLint exits with one of the following exit codes:
1106
1106
1107
1107
-`0`: Linting was successful and there are no linting errors. If the [`--max-warnings`](#--max-warnings) flag is set to `n`, the number of linting warnings is at most `n`.
1108
-
-`1`: Linting was successful and there is at least one linting error, or there are more linting warnings than allowed by the `--max-warnings` option.
1108
+
-`1`: Linting was successful and there is at least one linting error, or there are more linting warnings than allowed by the [`--max-warnings`](#--max-warnings) option.
1109
1109
-`2`: Linting was unsuccessful due to a configuration problem or an internal error.
Copy file name to clipboardExpand all lines: docs/src/use/configure/combine-configs.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ In many cases, you won't write an ESLint config file from scratch, but rather, y
11
11
12
12
## Apply a Config Object
13
13
14
-
If you are importing an object from another module, in most cases, you can just pass the object directly to the `defineConfig()` helper. For example, you can use the recommended rule configurations for JavaScript by importing the `recommended` config and using it in your array:
14
+
If you are importing a [config object](../core-concepts/glossary#config-object) from another module, in most cases, you can just pass the object directly to the `defineConfig()` helper. For example, you can use the recommended rule configurations for JavaScript by importing the `recommended` config and using it in your array:
15
15
16
16
```js
17
17
// eslint.config.js
@@ -54,7 +54,7 @@ Here, the `js/recommended` config object is applied only to files that match the
54
54
55
55
## Apply a Config Array
56
56
57
-
If you are importing an array from another module, pass the array directly to the `defineConfig()` helper. Here's an example:
57
+
If you are importing a [config array](../core-concepts/glossary#config-array) from another module, pass the array directly to the `defineConfig()` helper. Here's an example:
Copy file name to clipboardExpand all lines: docs/src/use/configure/debug.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ESLint creates a configuration for each file that is linted based on your config
15
15
16
16
**Use When:** You aren't sure if the correct configuration file is being read. This may happen if you have multiple configuration files in the same project.
17
17
18
-
**What To Do:** Run ESLint with the `--debug` command line flag and pass the file to check, like this:
18
+
**What To Do:** Run ESLint with the [`--debug`](../command-line-interface#--debug) command line flag and pass the file to check, like this:
19
19
20
20
{{ npx_tabs({
21
21
package: "eslint",
@@ -35,7 +35,7 @@ eslint:eslint Config file URL is file:///C:/Users/nzakas/projects/eslint/eslint/
35
35
36
36
**Use When:** You aren't sure why linting isn't producing the expected results, either because it seems like your rule configuration isn't being honored or the wrong language options are being used.
37
37
38
-
**What To Do:** Run ESLint with the `--print-config` command line flag and pass the file to check, like this:
38
+
**What To Do:** Run ESLint with the [`--print-config`](../command-line-interface#--print-config) command line flag and pass the file to check, like this:
39
39
40
40
{{ npx_tabs({
41
41
package: "eslint",
@@ -69,7 +69,7 @@ You won't see any entries for `files`, `ignores`, or `name`, because those are o
69
69
70
70
**Use When:** You aren't sure if certain configuration objects in your configuration file match a given filename.
71
71
72
-
**What To Do:** Run ESLint with the `--inspect-config` command line flag and pass the file to check, like this:
72
+
**What To Do:** Run ESLint with the [`--inspect-config`](../command-line-interface#--inspect-config) command line flag and pass the file to check, like this:
This configuration specifies that all of the files in the `.config` directory should be ignored. This pattern is added after the default patterns, which are `["**/node_modules/", ".git/"]`.
36
36
37
-
You can also ignore files on the command line using `--ignore-pattern`, such as:
37
+
You can also ignore files on the command line using [`--ignore-pattern`](../command-line-interface#--ignore-pattern), such as:
38
38
39
39
{{ npx_tabs({
40
40
package: "eslint",
@@ -116,7 +116,7 @@ Note that only global `ignores` patterns can match directories.
116
116
`ignores` patterns that are specific to a configuration will only match file names.
117
117
:::
118
118
119
-
You can also unignore files on the command line using `--ignore-pattern`, such as:
119
+
You can also unignore files on the command line using [`--ignore-pattern`](../command-line-interface#--ignore-pattern), such as:
120
120
121
121
{{ npx_tabs({
122
122
package: "eslint",
@@ -128,8 +128,8 @@ You can also unignore files on the command line using `--ignore-pattern`, such a
128
128
How glob patterns are evaluated depends on where they are located and how they are used:
129
129
130
130
1. When using `ignores` in an `eslint.config.js` file, glob patterns are evaluated relative to the `eslint.config.js` file.
131
-
1. When using `ignores` in an alternate configuration file specified using the `--config` command line option, glob patterns are evaluated relative to the current working directory.
132
-
1. When using `--ignore-pattern`, glob patterns are evaluated relative to the current working directory.
131
+
1. When using `ignores` in an alternate configuration file specified using the [`--config`](../command-line-interface#-c---config) command line option, glob patterns are evaluated relative to the current working directory.
132
+
1. When using [`--ignore-pattern`](../command-line-interface#--ignore-pattern), glob patterns are evaluated relative to the current working directory.
133
133
134
134
## Name the Global Ignores Config
135
135
@@ -140,7 +140,7 @@ By default, `globalIgnores()` will assign a name to the config that represents y
@@ -177,7 +177,7 @@ This message occurs because ESLint is unsure if you wanted to actually lint the
177
177
178
178
## Including `.gitignore` Files
179
179
180
-
If you want to include patterns from a `.gitignore` file or any other file with gitignore-style patterns, you can use [`includeIgnoreFile`](https://github.com/eslint/rewrite/tree/main/packages/compat#including-ignore-files) utility from the [`@eslint/compat`](https://www.npmjs.com/package/@eslint/compat) package.
180
+
If you want to include patterns from a [`.gitignore`](https://git-scm.com/docs/gitignore) file or any other file with gitignore-style patterns, you can use [`includeIgnoreFile`](https://github.com/eslint/rewrite/tree/main/packages/compat#including-ignore-files) utility from the [`@eslint/compat`](https://www.npmjs.com/package/@eslint/compat) package.
Copy file name to clipboardExpand all lines: docs/src/use/troubleshooting/couldnt-find-the-plugin.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,6 @@ Common resolutions for this issue include:
60
60
61
61
For more information, see:
62
62
63
-
-[Legacy ESLint configuration files](../configure/configuration-files-deprecated#using-a-shareable-configuration-package) for documentation on the legacy ESLint configuration format
64
-
-[Configure Plugins](../configure/plugins) for documentation on how to extend from plugins
65
-
-[Create Plugins](../../extend/plugins#configs-in-plugins) for documentation on how to define plugins
63
+
-[Legacy ESLint configuration files](../configure/configuration-files-deprecated#using-a-shareable-configuration-package) for documentation on the legacy ESLint configuration format.
64
+
-[Configure Plugins](../configure/plugins) for documentation on how to extend from plugins.
65
+
-[Create Plugins](../../extend/plugins#configs-in-plugins) for documentation on how to define plugins.
ESLint comes with several built-in formatters to control the appearance of the linting results, and supports third-party formatters as well.
12
12
13
-
You can specify a formatter using the `--format` or `-f` flag in the CLI. For example, `--format json` uses the `json` formatter.
13
+
You can specify a formatter using the [`--format` or `-f`](../command-line-interface#-f---format) flag in the CLI. For example, `--format json` uses the `json` formatter.
14
14
15
15
The built-in formatter options are:
16
16
@@ -20,7 +20,7 @@ The built-in formatter options are:
20
20
21
21
## Example Source
22
22
23
-
Examples of each formatter were created from linting `fullOfProblems.js` using the `.eslintrc.json` configuration shown below.
23
+
Examples of each formatter were created from linting `fullOfProblems.js` using the `eslint.config.js` configuration shown below.
0 commit comments