Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccee1a2

Browse files
authored
docs: add examples of overrides without type information (typescript-eslint#4379)
1 parent 6acb4d6 commit ccee1a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/linting/TYPED_LINTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Depending on what you want to achieve:
6060
- If you **do** want to lint the file:
6161
- If you **do not** want to lint the file with [type-aware linting](./TYPED_LINTING.md):
6262
- Use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information.
63+
- A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override.
64+
- Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work.
6365
- If you **do** want to lint the file with [type-aware linting](./TYPED_LINTING.md):
6466
- Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
6567
- If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo:

0 commit comments

Comments
 (0)