Skip to content

Commit

Permalink
docs: fix Ignoring Files section in config migration guide (#17392)
Browse files Browse the repository at this point in the history
* docs: fix Ignoring Files section in config migration guide

* remove extra blank line
  • Loading branch information
mdjermanovic committed Jul 20, 2023
1 parent 8a9abb7 commit 80dffed
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/src/use/configure/migration-guide.md
Expand Up @@ -345,14 +345,14 @@ export default [

With eslintrc, you can make ESLint ignore files by creating a separate `.eslintignore` file in the root of your project. The `.eslintignore` file uses the same glob pattern syntax as `.gitignore` files. Alternatively, you can use an `ignorePatterns` property in your eslintrc file.

To ignore files with flat config, you can use the `ignores` property in a config object. The `ignores` property accepts an array of glob patterns. Note that flat config glob patterns do _not_ match dot files (e.g. `*.js` won't match `.dotfile.js`). Flat config does not support loading ignore patterns from `.eslintignore` files, so you'll need to migrate those patterns directly into flat config.
To ignore files with flat config, you can use the `ignores` property in a config object. The `ignores` property accepts an array of glob patterns. Flat config does not support loading ignore patterns from `.eslintignore` files, so you'll need to migrate those patterns directly into flat config.

For example, here's a `.eslintignore` example you can use with an eslintrc config:

```shell
# .eslintignore
temp.js
.config/*
config/*
# ...other ignored files
```

Expand All @@ -362,21 +362,23 @@ temp.js
// .eslintrc.js
module.exports = {
// ...other config
ignorePatterns: ["temp.js", ".config/*"],
ignorePatterns: ["temp.js", "config/*"],
};
```

Here are the same files ignore patterns in flat config:

```javascript
export default [
// ...other config
{
// ...other config
ignores: ["temp.js", ".config/*"]
ignores: ["**/temp.js", "config/*"]
}
];
```

Also, with flat config, dotfiles (e.g. `.dotfile.js`) are no longer ignored by default. If you want to ignore dotfiles, add files ignore pattern `"**/.*"`.

### Linter Options

ESlintrc files let you configure the linter itself with the `noInlineConfig` and `reportUnusedDisableDirectives` properties.
Expand Down

0 comments on commit 80dffed

Please sign in to comment.