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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manually overriding forced project inclusion of 2.0.0 #915

Closed
bbugh opened this issue Aug 28, 2019 · 2 comments
Closed

Allow manually overriding forced project inclusion of 2.0.0 #915

bbugh opened this issue Aug 28, 2019 · 2 comments
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser

Comments

@bbugh
Copy link

bbugh commented Aug 28, 2019

The 2.0.0 parser is a great new feature, glad to hear that you sorted out the performance issues in #389. 馃専 This project must be a huge undertaking and you're doing an awesome job with it.

What code were you trying to parse?

A file outside of my project files, manually.

For example, just now I wanted to lint my .eslintrc.js config one time. There doesn't seem to be a way to do that now.

yarn eslint --fix .eslintrc.js --no-ignore

What did you expect to happen?

The linter correctly understood that I was linting files outside of my project, and allow it to lint without issue.

Is there a flag we can pass to say "yes I know this file is outside of my project but I want you to lint it anyway"? Perhaps @typescript-eslint can use eslint's ignore flags internally somehow? I don't have any need for a special linting tsconfig.eslint.json, just occasional one-time lints.

What actually happened?

I had to remove project: './tsconfig.json', from my package.json. That then requires me to remove plugin:@typescript-eslint/recommended-requiring-type-checking because of this 2.0.0 change.

Versions

package version
@typescript-eslint/parser 2.0.0
TypeScript 3.5.3
ESLint 6.2.2
node 10.15.3
npm 6.4.1
yarn 1.17.3
@bbugh bbugh added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels Aug 28, 2019
@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Aug 28, 2019
@bradzacher
Copy link
Member

Thanks!


https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration

There's no flag, but you can set parserOptions.createDefaultProgram = true. This will turn on the old code path and allow you to lint the file.
Recommended that you turn it right back off after you finish, otherwise you open yourself up to the old performance issues.

AFAIK, we don't have access to eslint CLI flags, so we can't tell that you passed the --no-ignore flag without manually building a cli arg parser with specific knowledge of eslint args.

It's such a rare case to lint a single file exactly once and never again, so I think it's probably not worth the effort to build any code paths in for this?

@bradzacher
Copy link
Member

Going to close this as there's nothing we can do about this as per the previous comment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

2 participants