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

XO should not lint type definition files in a non-TS project #348

Closed
sindresorhus opened this issue Aug 20, 2018 · 4 comments
Closed

XO should not lint type definition files in a non-TS project #348

sindresorhus opened this issue Aug 20, 2018 · 4 comments

Comments

@sindresorhus
Copy link
Member

sindresorhus commented Aug 20, 2018

Many CommonJS (non-TS) projects have a TS type definition file, like index.d.ts and it currently has to be manually ignored because XO tries to lint it: https://travis-ci.org/sindresorhus/delay/jobs/418345973

How should we handle this? I don't think users should be forced to manually ignore type definition files.

We could ignore files ending in .d.ts unless the user has typescript-eslint-parser?

@pvdlg
Copy link
Contributor

pvdlg commented Aug 24, 2018

We could ignore files ending in .d.ts unless the user has typescript-eslint-parser?

Sounds a good idea.

sindresorhus added a commit that referenced this issue Sep 3, 2018
It causes a lot of problems with non-TS project that have type definition files and non-TS projects that have TS fixture files.

See #348
@sindresorhus
Copy link
Member Author

sindresorhus commented Sep 3, 2018

I decided to remove the extensions for now. They cause a lot of problems and I'm not sure what the correct solution is.


We could ignore files ending in .d.ts unless the user has typescript-eslint-parser?

We actually cannot easily check whether the typescript parser is included as we would have to resolve the whole extends config chain, which we currently leave up to ESLint, and ESLint doesn't expose any API for us to do this.

@sindresorhus
Copy link
Member Author

I think a better solution is this: eslint/eslint#10828 (Please vote on it)

@pvdlg
Copy link
Contributor

pvdlg commented Feb 25, 2020

@sindresorhus this can be closed since #426 was merged right?

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

No branches or pull requests

2 participants