Skip to content

Commit eff756e

Browse files
committed
docs: revert/discard all ignore.md changes
1 parent 732ee28 commit eff756e

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

docs/src/use/configure/ignore.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -62,60 +62,6 @@ export default [
6262
];
6363
```
6464

65-
## Global Ignores
66-
67-
::: tip
68-
Global `ignores` is what you need if you want to define files and directories to ignore in a single place and avoid to add the same `ignores` property to every configuration objects.
69-
:::
70-
71-
In ESLint, there is a concept of global `ignores`, to better explain it let's see first how configuration object works in ESLint.
72-
73-
ESLint configuration file is intended to be used like this: export a single array, that contains multiple [configuration objects](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects), each one being an item of the array.
74-
75-
It's important to note that each configuration object is independent from other ones. Because of that, the `ignores` property defined in one configuration object is not applied to other configuration objects of the array.
76-
77-
```js
78-
// eslint.config.js
79-
80-
export default [
81-
{ name: "config-1", files: "src/**/*.js", ignores: ["**/*.config.js"], ... },
82-
{ name: "config-2", files: "scripts/**/*.js", ignores: ["**/dir/**"], ... },
83-
// ...
84-
];
85-
```
86-
87-
In the code above, the `ignores` directive of `config-1` is not applied on `config-2`, and vice-versa. If this is what you want, use this pattern.
88-
89-
But if you want to apply a particular `ignores` pattern to all configuration objects of the configuration array, global `ignores` is exactly made for this scenario.
90-
91-
The usage is the following:
92-
93-
* define a configuration object with a single property, `ignores` .
94-
* **don't add any other property** to this configuration object other than `ignores` property.
95-
* place this configuration object as **first item** of the configuration array.
96-
97-
This way every configuration object that follow this one inherit the global `ignores`.
98-
99-
```js
100-
// eslint.config.js
101-
102-
import globals from "globals";
103-
import pluginJs from "@eslint/js";
104-
import tseslint from "typescript-eslint";
105-
106-
export default [
107-
// DO NOT PUT OTHER PROPS IN THIS OBJECT, SO IT
108-
// BEHAVES AS GLOBAL IGNORES
109-
{ ignores: [".config/*", "dist/"] },
110-
111-
// THE IGNORES IS APPLIED ALSO TO THESE FOLLOWING CONFIGS
112-
{ files: ["**/*.{js,mjs,cjs,ts}"] },
113-
{ languageOptions: { globals: globals.browser } },
114-
pluginJs.configs.recommended,
115-
...tseslint.configs.recommended,
116-
];
117-
```
118-
11965
## Unignoring Files and Directories
12066

12167
You can also unignore files and directories that are ignored by previous patterns, including the default patterns. For example, this config unignores `node_modules/mylibrary`:

0 commit comments

Comments
 (0)