Skip to content

Commit

Permalink
Add FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Jul 30, 2024
1 parent 6e0f3fa commit 2dcef73
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions designs/2024-config-lookup-from-file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@ In this scenario:
1. `eslint .` - ESLint first reads `./eslint.config.js`, which has an `ignores` pattern that doesn't match any of the child directories, so ESLint traverses into each child directory. Once in `subdir`, ESLint reads `./subdir/eslint.config.js`, which says to ignore `subsubdir2`, so ESLint skips traversing into `subsubdir2` but still traverses into `subsubdir1`. ESLint lints `./eslint.config.js`, `./subdir/eslint.config.js`, and `./subdir/subsubdir1/file.js`.
1. `eslint subdir` - ESLint first reads `./subdir/eslint.config.js` which says to ignore `subsubdir2`, so ESLint skips traversing into `subsubdir2` but still traverses into `subsubdir1`. ESLint lints `./subdir/eslint.config.js`, and `./subdir/subsubdir1/file.js`.

### What happens when I run `eslint *`?

Consider this example:

```
/usr/tmp/
└── subdir/
├── eslint.config.js
├── subsubdir1/
│ └── file.js
└── subsubdir2/
└── file.js
```

When you run `eslint *`, it's the same as if you ran `eslint subdir`, as it matches all immediate children of `.`. If the immediate children include `node_modules` and `.git`, those will still be ignored because they are default ignores in ESLint. All other subdirectories will be traversed but will only be linted if there's an `eslint.config.js` file present, as is the case with `./subdir` in this example.

## Related Discussions

Expand Down

0 comments on commit 2dcef73

Please sign in to comment.