From 5294db1a221bffd8681a250f5e6515b53c46fc67 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 25 Jun 2024 01:04:43 -0400 Subject: [PATCH 1/2] docs: mention out-of-date editor type information FAQ --- docs/troubleshooting/typed-linting/index.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx index 6723ae5aea34..adcdd29e9d1a 100644 --- a/docs/troubleshooting/typed-linting/index.mdx +++ b/docs/troubleshooting/typed-linting/index.mdx @@ -7,6 +7,19 @@ slug: /troubleshooting/typed-linting import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Editor ESLint reports become out-of-date after file changes + +There is a known issue in at least VS Code with typed linting that files might have out-of-date lint errors after multiple updates to files on disk. +The root cause is that ESLint doesn't provide a way for editors to know about cross-file dependencies, such as type information. +This results in files receiving out-of-date type information when files they import from are changed. + +You might see this as erroneous `no-unsafe-*` rule complaints on `any` or `error typed` values. +Other rules may be more subtly incorrect. + +For now, the workaround of to run the _**Restart ESLint Server**_ command in VS Code (or an equivalent in other editors) when types get out of date. + +See [ESLint does not re-compute cross-file information on file changes (microsoft/vscode-eslint#1774)](https://github.com/microsoft/vscode-eslint/issues/1774) for more information. + ## I get errors telling me "Having many files run with the default project is known to cause performance issues and slow down linting." From 322f1311ff677e05d7387ab8220da5c2d90e9a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 29 Jun 2024 10:30:09 -0400 Subject: [PATCH 2/2] Update docs/troubleshooting/typed-linting/index.mdx --- docs/troubleshooting/typed-linting/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx index adcdd29e9d1a..9488d8199927 100644 --- a/docs/troubleshooting/typed-linting/index.mdx +++ b/docs/troubleshooting/typed-linting/index.mdx @@ -16,7 +16,7 @@ This results in files receiving out-of-date type information when files they imp You might see this as erroneous `no-unsafe-*` rule complaints on `any` or `error typed` values. Other rules may be more subtly incorrect. -For now, the workaround of to run the _**Restart ESLint Server**_ command in VS Code (or an equivalent in other editors) when types get out of date. +For now, the workaround is to run the _**Restart ESLint Server**_ command in VS Code (or an equivalent in other editors) when types get out of date. See [ESLint does not re-compute cross-file information on file changes (microsoft/vscode-eslint#1774)](https://github.com/microsoft/vscode-eslint/issues/1774) for more information.