Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsconfig.json is being cached between runs and not purged on change #20

Open
fregante opened this issue Dec 1, 2019 · 3 comments
Open

Comments

@fregante
Copy link
Member

fregante commented Dec 1, 2019

Repro.zip

➡️ Run:

npm i
npm test

❌ You get:

> xo

  a.ts:1:7
  ✖  1:7  a is assigned a value but never used.                                                                                                                                                                    @typescript-eslint/no-unused-vars

  b.ts:undefined:undefined
  ✖  0:0  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: b.ts.
The file must be included in at least one of the projects provided.  

  2 errors

Ok, I guess, tsconfig.json is:

{
	"include": [
		"a.ts"
	]
}

➡️ Change it to include the missing file:

{
	"include": [
		"a.ts",
		"b.ts"
	]
}

➡️ Run:

npm test

Same result as above. It's still complaining that b.ts isn't included but it's included. Crazy.

➡️ Run:

trash node_modules # or # rm -rf node_modules
npm i
npm test

It works.

I also included .eslintrc with which you can verify that eslint isn't doing this. Replace test in package.json with eslint *.ts

@sindresorhus
Copy link
Member

This is probably caused by xo's caching, which is really just ESLint's caching. I guess TypeScript-ESLint doesn't correctly update the cache or something.

@dobromyslov
Copy link

Have same issue. I use xo and eslint both in one project. xo for cli and eslint for WebStorm.
node_modules removal helps. @fregante thank you for the workaround.

@JounQin
Copy link

JounQin commented Jun 25, 2022

Cache is handled by ESLint itself, not TypeScript-ESLint, and ESLint does not understand tsconfig.json should invalidate cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants