-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
@typescript-eslint/parser
doesn't ignore files, which is excluded by/in tsconfig.json
#905
Comments
tsconfig.json
tsconfig.json
tsconfig.json
@typescript-eslint/parser
doesn't ignore files, which is excluded by/in tsconfig.json
What command are you running to do your linting? If you want to exclude files, either use a |
I'm running
The glob is actually the same therefore I have to provide an additional option in cli to ignore some files |
It's not a good idea to do zero linting on test files. That aside, ESLint passes us the list of files, which it takes from the CLI. We cannot control this list, we can only act based upon this list. The action we take is to inform you (via an error) that you've asked eslint to lint a file that you've excluded. This is done on purpose because we can't tell the difference between an explicitly excluded file (i.e. one that was added to If you have a complex set of excludes in your tsconfig, you should use a Or you should consider providing a more inclusive tsconfig via creating a new |
Gotcha! |
@bradzacher ,
It looks like {
"compilerOptions": {
// will be ignored because of `include`:
"baseUrl": "./",
"paths": {
"@SourceFiles:Root/*": ["./Source/*"],
"@ProjectBuilder:Root/*": ["./Source/ProjectBuilder/*"],
// ...
},
"include": [
"Source/**/*.(ts|vue)"
]
} |
Google doesn't always index github readmes fully. You should consider using the github search feature instead. It's listed in the parser readme: As well as the 2.0.0 release notes: There are currently some problems with parsing vue files, because vue is a weird, very custom, use case that is unsupported by typescript. See #883 |
Thanks @bradzacher , I duplicated my tsconfig.json and removed the |
@lvl99 , duplicated tsconfig.json?! Is it normal practice or just a hack? |
@tokugawatakesi it was a quick hack to get working, then I remembered the
This lets me target all files in src (I have all my tests within src too) and exclude none for purposes of compiling TS for eslint. |
@lvl99, I see, thank you for sharing of your solution! |
It should be as simple as creating an
|
In case of
project
is specified withinparserOptions
,@typescript-eslint/parser
doesn't ignore files, which is excluded by/intsconfig.json
.What did you expect to happen?
Excluded files should be ignored by
eslint
.What actually happened?
Versions
@typescript-eslint/parser
2.0.0
TypeScript
3.5.3
ESLint
6.2.2
node
10.16.3
npm
6.9.0
The text was updated successfully, but these errors were encountered: