Content-Length: 328459 | pFad | https://github.com/eslint/eslint/commit/73408de08dbe1873bf6b5564533c0d81134cfeee

CE docs: add link to configuration file docs before examples (#18535) · eslint/eslint@73408de · GitHub
Skip to content

Commit

Permalink
docs: add link to configuration file docs before examples (#18535)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Jun 3, 2024
1 parent 2c8fd34 commit 73408de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/src/use/configure/language-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ESLint allows you to specify the JavaScript language options you want to support
* `commonjs` - CommonJS module (useful if your code uses `require()`). Your code has a top-level function scope and runs in non-strict mode.
* `script` - non-module. Your code has a shared global scope and runs in non-strict mode.

Here's an example configuration file you might use when linting ECMAScript 5 code:
Here's an example [configuration file](./configuration-files#configuration-file) you might use when linting ECMAScript 5 code:

```js
// eslint.config.js
Expand All @@ -47,7 +47,7 @@ If you are using the built-in ESLint parser, you can additionally change how ESL
* `impliedStrict` - enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is `5` or greater)
* `jsx` - enable [JSX](https://facebook.github.io/jsx/)

Here's an example configuration file that enables JSX parsing in the default parser:
Here's an example [configuration file](./configuration-files#configuration-file) that enables JSX parsing in the default parser:

```js
// eslint.config.js
Expand Down Expand Up @@ -88,7 +88,7 @@ This defines two global variables, `var1` and `var2`. If you want to optionally

### Using configuration files

To configure global variables inside of a configuration file, set the `languageOptions.globals` configuration property to an object containing keys named for each of the global variables you want to use. For each global variable key, set the corresponding value equal to `"writable"` to allow the variable to be overwritten or `"readonly"` to disallow overwriting. For example:
To configure global variables inside of a [configuration file](./configuration-files#configuration-file), set the `languageOptions.globals` configuration property to an object containing keys named for each of the global variables you want to use. For each global variable key, set the corresponding value equal to `"writable"` to allow the variable to be overwritten or `"readonly"` to disallow overwriting. For example:

```js
// eslint.config.js
Expand Down
4 changes: 2 additions & 2 deletions docs/src/use/configure/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can extend ESLint with plugins in a variety of different ways. Plugins can i

ESLint supports the use of third-party plugins. Plugins are simply objects that conform to a specific interface that ESLint recognizes.

To configure plugins inside of a configuration file, use the `plugins` key, which contains an object with properties representing plugin namespaces and values equal to the plugin object.
To configure plugins inside of a [configuration file](./configuration-files#configuration-file), use the `plugins` key, which contains an object with properties representing plugin namespaces and values equal to the plugin object.

```js
// eslint.config.js
Expand Down Expand Up @@ -162,7 +162,7 @@ This configuration object uses `jsd` as the prefix plugin instead of `jsdoc`.

Plugins may provide processors. Processors can extract JavaScript code from other kinds of files, then let ESLint lint the JavaScript code. Alternatively, processors can convert JavaScript code during preprocessing.

To specify processors in a configuration file, use the `processor` key and assign the name of processor in the format `namespace/processor-name`. For example, the following uses the processor from `eslint-plugin-markdown` for `*.md` files.
To specify processors in a [configuration file](./configuration-files#configuration-file), use the `processor` key and assign the name of processor in the format `namespace/processor-name`. For example, the following uses the processor from `eslint-plugin-markdown` for `*.md` files.

```js
// eslint.config.js
Expand Down
6 changes: 3 additions & 3 deletions docs/src/use/configure/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Configuration comments can include descriptions to explain why the comment is ne

### Using Configuration Files

To configure rules inside of a configuration file, use the `rules` key along with an error level and any options you want to use. For example:
To configure rules inside of a [configuration file](./configuration-files#configuration-file), use the `rules` key along with an error level and any options you want to use. For example:

```js
export default [
Expand Down Expand Up @@ -133,7 +133,7 @@ Rules configured via configuration comments have the highest priority and are ap

To configure a rule that is defined within a plugin, prefix the rule ID with the plugin namespace and `/`.

In a configuration file, for example:
In a [configuration file](./configuration-files#configuration-file), for example:

```js
// eslint.config.js
Expand Down Expand Up @@ -304,7 +304,7 @@ console.log('hello');

### Using configuration files

To disable rules inside of a configuration file for a group of files, use a subsequent config object with a `files` key. For example:
To disable rules inside of a [configuration file](./configuration-files#configuration-file) for a group of files, use a subsequent config object with a `files` key. For example:

```js
// eslint.config.js
Expand Down

0 comments on commit 73408de

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/eslint/eslint/commit/73408de08dbe1873bf6b5564533c0d81134cfeee

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy