Skip to content

Commit

Permalink
docs: document lack of config file names (#17442)
Browse files Browse the repository at this point in the history
* docs: document lack of config file names

* Update configuration-files-new.md

* Update docs/src/use/configure/configuration-files-new.md

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>

---------

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
  • Loading branch information
Zamiell and nzakas committed Aug 4, 2023
1 parent a1635d6 commit a766a48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/src/use/configure/configuration-files-new.md
Expand Up @@ -58,6 +58,10 @@ module.exports = (async () => {
})();
```

::: warning
ESLint only automatically looks for a config file named `eslint.config.js` and does not look for `eslint.config.cjs` or `eslint.config.mjs`. If you'd like to specify a different config filename than the default, use the `--config` command line option.
:::

## Configuration Objects

Each configuration object contains all of the information ESLint needs to execute on a set of files. Each configuration object is made up of these properties:
Expand Down Expand Up @@ -667,7 +671,7 @@ When ESLint is run on the command line, it first checks the current working dire
You can prevent this search for `eslint.config.js` by setting the `ESLINT_USE_FLAT_CONFIG` environment variable to `true` and using the `-c` or `--config` option on the command line to specify an alternate configuration file, such as:

```shell
ESLINT_USE_FLAT_CONFIG=true npx eslint -c some-other-file.js **/*.js
ESLINT_USE_FLAT_CONFIG=true npx eslint --config some-other-file.js **/*.js
```

In this case, ESLint does not search for `eslint.config.js` and instead uses `some-other-file.js`.

0 comments on commit a766a48

Please sign in to comment.