Skip to content

Commit

Permalink
docs: Improve ignores documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Jun 7, 2023
1 parent 788d836 commit ebc8cbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/src/use/configure/configuration-files-new.md
Expand Up @@ -116,7 +116,7 @@ export default [

Here, the configuration object excludes files ending with `.config.js` except for `eslint.config.js`. That file still has `semi` applied.

If `ignores` is used without `files` and any other setting, then the configuration object applies to all files except the ones specified in `ignores`, for example:
If `ignores` is used without `files` and there are other keys (such as `rules`), then the configuration object applies to all files except the ones specified in `ignores`, for example:

```js
export default [
Expand Down Expand Up @@ -145,6 +145,9 @@ export default [

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/**"]`.

Note that only global `ignores` patterns can ignore or unignore whole directories.
`ignores` patterns that are specific to a configuration will only match file names.

#### Cascading configuration objects

When more than one configuration object matches a given filename, the configuration objects are merged with later objects overriding previous objects when there is a conflict. For example:
Expand Down

0 comments on commit ebc8cbb

Please sign in to comment.