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
feat!: remove v10_* and inactive unstable_* flags (#20225)
* fix!: remove `v10_*` and inactive `unstable_*` flags
* format
* remove `LegacyConfigLoader`
* fix ci
* revert removal of CLI test
* Merge branch 'main' into remove-v10-config-flags
* update the migration guide
* update v10 migration guide
* revert formatting change
* show just one form of the CLI option to avoid confusion
Copy file name to clipboardExpand all lines: docs/src/use/configure/configuration-files.md
+3-19Lines changed: 3 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -780,32 +780,16 @@ export default {
780
780
781
781
## Configuration File Resolution
782
782
783
-
When ESLint is run on the command line, it first checks the current working directory for `eslint.config.js`. If that file is found, then the search stops, otherwise it checks for `eslint.config.mjs`. If that file is found, then the search stops, otherwise it checks for`eslint.config.cjs`. If none of the files are found, it checks the parent directory for each file. This search continues until either a config file is found or the root directory is reached.
783
+
When ESLint is run on the command line, it determines configuration for each target file by first looking in the directory that contains the file and then searching up ancestor directories until it finds an`eslint.config.*`file. This behavior improves support for monorepos, where subdirectories can have their own configuration files.
784
784
785
-
You can prevent this search for `eslint.config.js`by using the `-c` or `--config` option on the command line to specify an alternate configuration file, such as:
785
+
You can prevent this search by using the `-c` or `--config` option on the command line to specify an alternate configuration file, such as:
In this case, ESLint does not search for `eslint.config.js` and instead uses `some-other-file.js`.
793
-
794
-
### Experimental Configuration File Resolution
795
-
796
-
::: warning
797
-
This feature is experimental and its details may change before being finalized. This behavior will be the new lookup behavior starting in v10.0.0, but you can try it today using a feature flag.
798
-
:::
799
-
800
-
You can use the `v10_config_lookup_from_file` flag to change the way ESLint searches for configuration files. Instead of searching from the current working directory, ESLint will search for a configuration file by first starting in the directory of the file being linted and then searching up its ancestor directories until it finds a `eslint.config.js` file (or any other extension of configuration file). This behavior is better for monorepos, where each subdirectory may have its own configuration file.
801
-
802
-
To use this feature on the command line, use the `--flag` flag:
803
-
804
-
```shell
805
-
npx eslint --flag v10_config_lookup_from_file .
806
-
```
807
-
808
-
For more information about using feature flags, see [Feature Flags](../../flags/).
792
+
In this case, ESLint does not search for configuration files and instead uses `some-other-file.js`.
## <aname="config-lookup-from-file"></a> New configuration file lookup algorithm
46
+
47
+
In ESLint v9, the alternate config lookup behavior could be enabled with the `v10_config_lookup_from_file` feature flag. This behavior made ESLint locate `eslint.config.*` by starting from the directory of each linted file and searching up towards the filesystem root. In ESLint v10, this behavior is now the default and the `v10_config_lookup_from_file` flag has been removed. Attempting to use this flag will now result in an error.
## <aname="no-shadow-restricted-names"></a> `no-shadow-restricted-names` now reports `globalThis` by default
44
60
45
61
In ESLint v10, the [`no-shadow-restricted-names`](../rules/no-shadow-restricted-names) rule now treats `globalThis` as a restricted name by default. Consequently, the `reportGlobalThis` option now defaults to `true` (previously `false`). As a result, declarations such as `const globalThis = "foo";` or `function globalThis() {}` will now be reported by default.
0 commit comments