Skip to content

Commit

Permalink
Docs: write about the home dir case eslint config (fixes eslint#7729)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorHom committed Oct 2, 2017
1 parent 434d9e2 commit 6a88fc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/user-guide/configuring.md
Expand Up @@ -509,7 +509,9 @@ your-project

If there is an `.eslintrc` and a `package.json` file found in the same directory, `.eslintrc` will take a priority and `package.json` file will not be used.

**Note:** If you have a personal configuration file in your home directory (`~/.eslintrc`), it will only be used if no other configuration files are found. Since a personal configuration would apply to everything inside of a user's directory, including third-party code, this could cause problems when running ESLint.
**Note:** If you have a personal configuration file in your home directory `~/.eslintrc`), it will only be used if no other configuration files are found. Since a personal configuration would apply to everything inside of a user's directory, including third-party code, this could cause problems when running ESLint.

**Note:**: If you run eslint from your home directory (`~/.eslintrc`) to test a file in your project (`~/your-project/tests/test.js`) and there is an eslint configuration in your project directory (`~/your-project/.eslintrc`), the eslint configuration in `~/.eslintrc` will *not* be used. The home directory configuration (`~/.eslintrc`) is a special case that will only be considered if no other configuration files are found.

By default, ESLint will look for configuration files in all parent folders up to the root directory. This can be useful if you want all of your projects to follow a certain convention, but can sometimes lead to unexpected results. To limit ESLint to a specific project, place `"root": true` inside the `eslintConfig` field of the `package.json` file or in the `.eslintrc.*` file at your project's root level. ESLint will stop looking in parent folders once it finds a configuration with `"root": true`.

Expand Down

0 comments on commit 6a88fc9

Please sign in to comment.