- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Various fixes to TypeScript integration #431
Conversation
I encountered an issue with the new TS integration. Clone this branch: https://github.com/sindresorhus/emittery/tree/upgrade-xo And
|
You need typescript in your project dependencies to be able to lint either I didn't add I didn't think of the case of a project that doesn't have it in it's dependencies. Maybe I can add that to the readme. |
XO is all about convenience though. I don't really want to install |
See PR #434 That would mean every XO user issue will download typescript on |
Are
|
Try |
The usual then. |
@pvdlg This change turned out to be really annoying because of Travis caching. Every time I upgrade XO, it will fail, and I have to manually clear Travis cache and then rerun. How about we change the cache directory |
Fix an issues introduced in #426
The key used to cache and group config wasn't working properly and had
ts
always beundefined
, preventing to split JS and TS files in two groups.As we were generating the temporary
tsconfig.json
with a different name every run the ESLint cache wasn't working properly has it would determine the config changed in between runs (due toparserOptions.project
) being different.We now generate those files in the XO cache with a consistent name, so in each run, the same set of files/tsconfig.json would result in the same temporary tsconfig.json file name.
Finally this solve a very rare case with a project with multiple XO configs. In such case were generating one temporary tsconfig.json per XO config. We now correctly generate temporary tsconfig per original one (and just one if the project doesn't have a tsconfig).
That would have created a situation were
@typescript-eslint/eslint-plugin
would have been unaware of the TS files that are not part of the currently linted group.Important for the release note:
After updating XO to a version with this fix, users will need to delete the current XO cache:
That's because now
node_modules/.cache/xo
should be a directory instead of a file so we can save both the ESLint cache and the temporary tsconfig.json.