Skip to content

Commit 8033b19

Browse files
authored
docs: add documentation for --no-config-lookup (#20033)
* docs: fix rule performance profiling instructions * remove comma * update CLI docs * update one more occurrence
1 parent ea789c7 commit 8033b19

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

docs/src/extend/custom-rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,10 @@ no-empty-class | 21.976 | 2.6%
991991
semi | 19.359 | 2.3%
992992
```
993993

994-
To test one rule explicitly, combine the `--no-eslintrc`, and `--rule` options:
994+
To test one rule explicitly, combine the `--no-config-lookup` and `--rule` options:
995995

996996
```bash
997-
$ TIMING=1 eslint --no-eslintrc --rule "quotes: [2, 'double']" lib
997+
$ TIMING=1 eslint --no-config-lookup --rule "quotes: [2, 'double']" lib
998998
Rule | Time (ms) | Relative
999999
:------|----------:|--------:
10001000
quotes | 18.066 | 100.0%

docs/src/use/command-line-interface.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,22 @@ Miscellaneous:
160160

161161
### Basic Configuration
162162

163+
#### `--no-config-lookup`
164+
165+
**Flat Config Mode Only.** Disables use of configuration from files.
166+
167+
- **Argument Type**: No argument.
168+
169+
##### `--no-config-lookup` example
170+
171+
{{ npx_tabs ({
172+
package: "eslint",
173+
args: ["--no-config-lookup", "file.js"]
174+
}) }}
175+
163176
#### `--no-eslintrc`
164177

165-
**eslintrc Mode Only.** Disables use of configuration from `.eslintrc.*` and `package.json` files. For flat config mode, use `--no-config-lookup` instead.
178+
**eslintrc Mode Only.** Disables use of configuration from `.eslintrc.*` and `package.json` files. For flat config mode, use [`--no-config-lookup`](#--no-config-lookup) instead.
166179

167180
- **Argument Type**: No argument.
168181

@@ -231,7 +244,7 @@ This option allows you to specify additional file extensions to lint.
231244
- **Multiple Arguments**: Yes
232245
- **Default Value**: By default, ESLint lints files with extensions `.js`, `.mjs`, `.cjs`, and additional extensions [specified in the configuration file](configure/configuration-files#specifying-files-with-arbitrary-extensions).
233246

234-
This option is primarily intended for use in combination with the `--no-config-lookup` option, since in that case there is no configuration file in which the additional extensions would be specified.
247+
This option is primarily intended for use in combination with the [`--no-config-lookup`](#--no-config-lookup) option, since in that case there is no configuration file in which the additional extensions would be specified.
235248

236249
##### `--ext` example
237250

@@ -365,7 +378,7 @@ This option specifies the rules to be used.
365378

366379
These rules are merged with any rules specified with configuration files. If the rule is defined in a plugin, you have to prefix the rule ID with the plugin name and a `/`.
367380

368-
To ignore rules in `.eslintrc` configuration files and only run rules specified in the command line, use the `--rule` flag in combination with the [`--no-eslintrc`](#--no-eslintrc) flag.
381+
To ignore rules in configuration files and only run rules specified in the command line, use the `--rule` flag in combination with the [`--no-config-lookup`](#--no-config-lookup) flag.
369382

370383
##### `--rule` example
371384

@@ -389,7 +402,7 @@ To ignore rules in `.eslintrc` configuration files and only run rules specified
389402

390403
{{ npx_tabs ({
391404
package: "eslint",
392-
args: ["--rule", "\'quotes: [error, double]\'", "--no-eslintrc"],
405+
args: ["--rule", "\'quotes: [error, double]\'", "--no-config-lookup"],
393406
comment: "Only apply rule from the command line"
394407
}) }}
395408

0 commit comments

Comments
 (0)