diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx index 526a79e03c63..9bc3afcbfd3c 100644 --- a/docs/linting/Troubleshooting.mdx +++ b/docs/linting/Troubleshooting.mdx @@ -174,6 +174,17 @@ You can see that the type of `condition` is actually the literal type `false` by If the IDE provides different type information from typescript-eslint's report, then make sure that the TypeScript setup used for your IDE, typescript-eslint, and `tsc` are the same: the same TypeScript version, the same type-checking compiler options, and the same files being included in the project. For example, if a type is declared in another file but that file is not included, the type will become `any`, and cause our `no-unsafe-*` rules to report. +## Can I use ESLint's `--cache` with typescript-eslint? + +[ESLint's `--cache` option](https://eslint.org/docs/latest/use/command-line-interface#caching) caches on a per-file basis. +You can use it, but it will only work reliably for untyped rules -- and even then, not always. + +Any ESLint rule that checks logic across files, including many rules from `eslint-plugin-import`, creates cross-file dependencies. +[Typed lint rules](./Typed_Linting.mdx) almost always have dependencies on types across files in practice. +ESLint's caching doesn't account for those cross-file dependencies. + +We don't recommend using `--cache`. + ## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config" You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeScript extensions to allow, for example: