Skip to content

Commit 6c4dee2

Browse files
authored
docs: Document homedir is a configuration root (#15469)
Fixes #14972
1 parent 6802a54 commit 6c4dee2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/user-guide/configuring/configuration-files.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If there are multiple configuration files in the same directory, ESLint will onl
3131

3232
There are two ways to use configuration files.
3333

34-
The first way to use configuration files is via `.eslintrc.*` and `package.json` files. ESLint will automatically look for them in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (unless `root: true` is specified). Configuration files can be useful when you want different configurations for different parts of a project or when you want others to be able to use ESLint directly without needing to remember to pass in the configuration file.
34+
The first way to use configuration files is via `.eslintrc.*` and `package.json` files. ESLint will automatically look for them in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (`/`), the home directory of the current user (`~/`), or when `root: true` is specified. See [Cascading and Hierarchy](#cascading-and-hierarchy) below for more details on this. Configuration files can be useful when you want different configurations for different parts of a project or when you want others to be able to use ESLint directly without needing to remember to pass in the configuration file.
3535

3636
The second way to use configuration files is to save the file wherever you would like and pass its location to the CLI using the `--config` option, such as:
3737

@@ -191,6 +191,8 @@ The complete configuration hierarchy, from highest to lowest precedence, is as f
191191
1. `.eslintrc.*` or `package.json` file in the same directory as the linted file
192192
1. Continue searching for `.eslintrc.*` and `package.json` files in ancestor directories up to and including the root directory or until a config with `"root": true` is found.
193193

194+
Please note that the [home directory of the current user on your preferred operating system](https://nodejs.org/api/os.html#os_os_homedir) (`~/`) is also considered a root directory in this context and searching for configuration files will stop there as well. And with the [removal of support for Personal Configuration Files](https://eslint.org/docs/user-guide/configuring/configuration-files#personal-configuration-files-deprecated) from the 8.0.0 release forward, configuration files present in that directory will be ignored.
195+
194196
## Extending Configuration Files
195197

196198
A configuration file, once extended, can inherit all the traits of another configuration file (including rules, plugins, and language options) and modify all the options. As a result, there are three configurations, as defined below:

0 commit comments

Comments
 (0)