Skip to content

Commit

Permalink
docs: indicate eslintrc mode for .eslintignore (#18285)
Browse files Browse the repository at this point in the history
* docs: remove obsolete references to `.eslintignore`

* add mention to eslintrc mode

* do not print .eslintignore notice in flat config

* Match default CLI output in the docs

Co-authored-by: Nicholas C. Zakas <[email protected]>

* Remove trailing dot

---------

Co-authored-by: Amaresh  S M <[email protected]>
Co-authored-by: Nicholas C. Zakas <[email protected]>
  • Loading branch information
3 people committed Apr 12, 2024
1 parent 32c08cf commit 200fd4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/src/use/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Fix Problems:
Ignore Files:
--no-ignore Disable use of ignore files and patterns
--ignore-pattern [String] Pattern of files to ignore (in addition to those in .eslintignore)
--ignore-pattern [String] Patterns of files to ignore
Use stdin:
--stdin Lint code provided on <STDIN> - default: false
Expand Down Expand Up @@ -426,7 +426,7 @@ npx eslint --no-ignore file.js

#### `--ignore-pattern`

This option allows you to specify patterns of files to ignore (in addition to those in `.eslintignore`).
This option allows you to specify patterns of files to ignore. In eslintrc mode, these are in addition to `.eslintignore`.

* **Argument Type**: String. The supported syntax is the same as for [`.eslintignore` files](configure/ignore-deprecated#the-eslintignore-file), which use the same patterns as the [`.gitignore` specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns.
* **Multiple Arguments**: Yes
Expand Down
4 changes: 2 additions & 2 deletions lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const optionator = require("optionator");
* @property {boolean} [help] Show help
* @property {boolean} ignore Disable use of ignore files and patterns
* @property {string} [ignorePath] Specify path of ignore file
* @property {string[]} [ignorePattern] Pattern of files to ignore (in addition to those in .eslintignore)
* @property {string[]} [ignorePattern] Patterns of files to ignore. In eslintrc mode, these are in addition to `.eslintignore`
* @property {boolean} init Run config initialization wizard
* @property {boolean} inlineConfig Prevent comments from changing config or rules
* @property {number} maxWarnings Number of warnings to trigger nonzero exit code
Expand Down Expand Up @@ -261,7 +261,7 @@ module.exports = function(usingFlatConfig) {
{
option: "ignore-pattern",
type: "[String]",
description: "Pattern of files to ignore (in addition to those in .eslintignore)",
description: `Patterns of files to ignore${usingFlatConfig ? "" : " (in addition to those in .eslintignore)"}`,
concatRepeatedArrays: [true, {
oneValuePerFlag: true
}]
Expand Down

0 comments on commit 200fd4e

Please sign in to comment.