Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 476d58a

Browse filesBrowse files
nzakasmdjermanovic
andauthored
docs: Add note about invalid CLI flags when using flat config. (#17664)
* fix: Add note about invalid CLI flags when using flat config. Fixes #17652 * Update docs/src/use/command-line-interface.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Upgrade config-array * Move error message --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent 5de9637 commit 476d58a
Copy full SHA for 476d58a

File tree

Expand file treeCollapse file tree

2 files changed

+13
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-6
lines changed

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

Copy file name to clipboardExpand all lines: docs/src/use/command-line-interface.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Miscellaneous:
121121

122122
#### `--no-eslintrc`
123123

124-
Disables use of configuration from `.eslintrc.*` and `package.json` files.
124+
**eslintrc Mode Only.** Disables use of configuration from `.eslintrc.*` and `package.json` files. For flat config mode, use `--no-config-lookup` instead.
125125

126126
* **Argument Type**: No argument.
127127

@@ -150,7 +150,7 @@ If `.eslintrc.*` and/or `package.json` files are also used for configuration (i.
150150

151151
#### `--env`
152152

153-
This option enables specific environments.
153+
**eslintrc Mode Only.** This option enables specific environments.
154154

155155
* **Argument Type**: String. One of the available environments.
156156
* **Multiple Arguments**: Yes
@@ -166,7 +166,7 @@ npx eslint --env browser --env node file.js
166166

167167
#### `--ext`
168168

169-
This option allows you to specify which file extensions ESLint uses when searching for target files in the directories you specify.
169+
**eslintrc Mode Only.** This option allows you to specify which file extensions ESLint uses when searching for target files in the directories you specify.
170170

171171
* **Argument Type**: String. File extension.
172172
* **Multiple Arguments**: Yes
@@ -232,7 +232,7 @@ echo '3 ** 4' | npx eslint --stdin --parser-options ecmaVersion:7 # succeeds, ya
232232

233233
#### `--resolve-plugins-relative-to`
234234

235-
Changes the directory where plugins are resolved from.
235+
**eslintrc Mode Only.** Changes the directory where plugins are resolved from.
236236

237237
* **Argument Type**: String. Path to directory.
238238
* **Multiple Arguments**: No
@@ -374,7 +374,7 @@ npx eslint --fix --fix-type suggestion,layout .
374374

375375
#### `--ignore-path`
376376

377-
This option allows you to specify the file to use as your `.eslintignore`.
377+
**eslintrc Mode Only.** This option allows you to specify the file to use as your `.eslintignore`.
378378

379379
* **Argument Type**: String. Path to file.
380380
* **Multiple Arguments**: No

‎lib/cli.js

Copy file name to clipboardExpand all lines: lib/cli.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,14 @@ const cli = {
318318
options = CLIOptions.parse(args);
319319
} catch (error) {
320320
debug("Error parsing CLI options:", error.message);
321-
log.error(error.message);
321+
322+
let errorMessage = error.message;
323+
324+
if (usingFlatConfig) {
325+
errorMessage += "\nYou're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.";
326+
}
327+
328+
log.error(errorMessage);
322329
return 2;
323330
}
324331

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.