Skip to content

Commit

Permalink
docs: 'a .eslint' -> 'an .eslint' for consistency (#16809)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpmutter committed Jan 23, 2023
1 parent 3be0748 commit ea10ca5
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -59,7 +59,7 @@ After that, you can run ESLint on any file or directory like this:

## Configuration

After running `npm init @eslint/config`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
After running `npm init @eslint/config`, you'll have an `.eslintrc` file in your directory. In it, you'll see some rules configured like this:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions docs/src/use/configure/configuration-files.md
Expand Up @@ -136,7 +136,7 @@ your-project
└── test.js
```

The configuration cascade works based on the location of the file being linted. If there is a `.eslintrc` file in the same directory as the file being linted, then that configuration takes precedence. ESLint then searches up the directory structure, merging any `.eslintrc` files it finds along the way until reaching either a `.eslintrc` file with `root: true` or the root directory.
The configuration cascade works based on the location of the file being linted. If there is an `.eslintrc` file in the same directory as the file being linted, then that configuration takes precedence. ESLint then searches up the directory structure, merging any `.eslintrc` files it finds along the way until reaching either an `.eslintrc` file with `root: true` or the root directory.

In the same way, if there is a `package.json` file in the root directory with an `eslintConfig` field, the configuration it describes is applied to all subdirectories beneath it. However, the configuration described by the `.eslintrc` file in the `tests/` directory overrides conflicting specifications.

Expand All @@ -150,7 +150,7 @@ your-project
└── test.js
```

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

By default, ESLint looks 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 `.eslintrc.*` file or `eslintConfig` field of the `package.json` file or in the `.eslintrc.*` file at your project's root level. ESLint stops looking in parent folders once it finds a configuration with `"root": true`.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/use/configure/ignore.md
Expand Up @@ -37,13 +37,13 @@ If a config is provided via the `--config` CLI option, the ignore patterns that

## The `.eslintignore` File

You can tell ESLint to ignore specific files and directories by creating a `.eslintignore` file in your project's root directory. The `.eslintignore` file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting. For example, the following omits all JavaScript files:
You can tell ESLint to ignore specific files and directories by creating an `.eslintignore` file in your project's root directory. The `.eslintignore` file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting. For example, the following omits all JavaScript files:

```text
**/*.js
```

When ESLint is run, it looks in the current working directory to find a `.eslintignore` file before determining which files to lint. If this file is found, then those preferences are applied when traversing directories. Only one `.eslintignore` file can be used at a time, so `.eslintignore` files other than the one in the current working directory are not used.
When ESLint is run, it looks in the current working directory to find an `.eslintignore` file before determining which files to lint. If this file is found, then those preferences are applied when traversing directories. Only one `.eslintignore` file can be used at a time, so `.eslintignore` files other than the one in the current working directory are not used.

Globs are matched using [node-ignore](https://github.com/kaelzhang/node-ignore), so a number of features are available:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/getting-started.md
Expand Up @@ -64,7 +64,7 @@ yarn run eslint yourfile.js

**Note:** If you are coming from a version before 1.0.0 please see the [migration guide](migrating-to-1.0.0).

After running `npm init @eslint/config`, you'll have a `.eslintrc.{js,yml,json}` file in your directory. In it, you'll see some rules configured like this:
After running `npm init @eslint/config`, you'll have an `.eslintrc.{js,yml,json}` file in your directory. In it, you'll see some rules configured like this:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/migrating-from-jscs.md
Expand Up @@ -30,7 +30,7 @@ To convert your configuration file, pass in the location of your `.jscs.json` fi
polyjuice --jscs .jscsrc.json > .eslintrc.json
```

This creates a `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.
This creates an `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.

If you have multiple `.jscsrc.json` files, you can pass them all and Polyjuice will combine them into one `.eslintrc.json` file:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/migrating-to-3.0.0.md
Expand Up @@ -15,7 +15,7 @@ With ESLint v3.0.0, we are dropping support for Node.js versions prior to 4. Nod

ESLint v3.0.0 now requires that you use a configuration to run. A configuration can be any of the following:

1. A `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc` file either in your project or home directory.
1. An `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc` file either in your project or home directory.
2. Configuration options passed on the command line using `--rule` (or to CLIEngine using `rules`).
3. A configuration file passed on the command line using `-c` (or to CLIEngine using `configFile`).
4. A base configuration is provided to CLIEngine using the `baseConfig` option.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/migrating-to-7.0.0.md
Expand Up @@ -108,7 +108,7 @@ Personal config files have been deprecated since [v6.7.0](https://eslint.org/blo
1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`.
1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`.

**To address:** Remove `~/.eslintrc.*` configuration files and add a `.eslintrc.*` configuration file to your project. Alternatively, use the `--config` option to use shared config files.
**To address:** Remove `~/.eslintrc.*` configuration files and add an `.eslintrc.*` configuration file to your project. Alternatively, use the `--config` option to use shared config files.

**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678)

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/cli-engine/cli-engine.js
Expand Up @@ -4433,7 +4433,7 @@ describe("CLIEngine", () => {
const cwd = getFixturePath("ignored-paths", "configurations");
const engine = new CLIEngine({ cwd });

// a .eslintignore in parent directories includes `*.js`, but don't load it.
// an .eslintignore in parent directories includes `*.js`, but don't load it.
assert(!engine.isPathIgnored("foo.js"));
assert(engine.isPathIgnored("node_modules/foo.js"));
});
Expand Down Expand Up @@ -4593,7 +4593,7 @@ describe("CLIEngine", () => {
const cwd = getFixturePath("ignored-paths", "no-ignore-file");
const engine = new CLIEngine({ ignorePath: false, cwd });

// a .eslintignore in parent directories includes `*.js`, but don't load it.
// an .eslintignore in parent directories includes `*.js`, but don't load it.
assert(!engine.isPathIgnored("foo.js"));
assert(engine.isPathIgnored("node_modules/foo.js"));
});
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/eslint/eslint.js
Expand Up @@ -4400,7 +4400,7 @@ describe("ESLint", () => {
const cwd = getFixturePath("ignored-paths", "configurations");
const engine = new ESLint({ cwd });

// a .eslintignore in parent directories includes `*.js`, but don't load it.
// an .eslintignore in parent directories includes `*.js`, but don't load it.
assert(!await engine.isPathIgnored("foo.js"));
assert(await engine.isPathIgnored("node_modules/foo.js"));
});
Expand Down

0 comments on commit ea10ca5

Please sign in to comment.