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

Skip to content

Commit 4bf832e

Browse files
author
Josh Goldberg
authored
docs: explain why there is not a "typescriptLocation" option (typescript-eslint#4373)
1 parent f8ad848 commit 4bf832e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/linting/TROUBLESHOOTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,19 @@ If you see more than one version installed, then you will have to either use [ya
153153

154154
**The best course of action in this case is to wait until your dependency releases a new version with support for our latest versions.**
155155

156+
## How can I specify a TypeScript version / `parserOptions.typescriptLocation`?
157+
158+
You can't, and you don't want to.
159+
160+
You should use the same version of TypeScript for linting as the rest of your project.
161+
TypeScript versions often have slight differences in edge cases that can cause contradictory information between typescript-eslint rules and editor information.
162+
For example:
163+
164+
- `@typescript-eslint/strict-boolean-expressions` might be operating with TypeScript version _X_ and think a variable is `string[] | undefined`
165+
- TypeScript itself might be on version _X+1-beta_ and think the variable is `string[]`
166+
167+
See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/issues/4102#issuecomment-963265514) for more details.
168+
156169
## My linting feels really slow
157170

158171
As mentioned in the [type-aware linting doc](./TYPED_LINTING.md), if you're using type-aware linting, your lint times should be roughly the same as your build times.

0 commit comments

Comments
 (0)