You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/use/configure/ignore.md
-54Lines changed: 0 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,60 +62,6 @@ export default [
62
62
];
63
63
```
64
64
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.
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
-
importglobalsfrom"globals";
103
-
importpluginJsfrom"@eslint/js";
104
-
importtseslintfrom"typescript-eslint";
105
-
106
-
exportdefault [
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
-
119
65
## Unignoring Files and Directories
120
66
121
67
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