-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Typed TSLint rules can fail on .vue snippets #2916
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
Comments
I notice that running |
I tried to adapt similar strategies demonstrated in fork-ts-checker-webpack-plugin. |
I'm getting a crash on the "deprecation" rule:
I think related? .... Is there a work-around for this? I tried to ignore deprecation but no change (in vue.config.js): config.plugin('fork-ts-checker')
.tap(args => {
args.ignoreLints = ['deprecation']
return args
}) |
Now that TSLint is officially deprecated, TSLint support will be fully dropped in the next major version; as for the current major version, no more bug fixes or features will be implemented except for security reasons. So I'm closing this issue now. |
Version
3.1.1
Reproduction link
https://github.com/millimoose/vue-tslint-microsoft-contrib-bug
Node and OS info
Node 9.7.1 / npm 6.4.1
Steps to reproduce
npm install
in that repronpm run lint --no-fix
What is expected?
Typed TSLint rules should only be run on files that have a corresponding entry in the backing TypeScript program. Some operations run on nodes in the files by TSLint rules query the program for type information only available on those files.
What is actually happening?
The Vue CLI is patching the program's
getSourceFile
to return a manually created file fromts.createSourceFile
for Vue files (perisVueFile
).vue-cli/packages/@vue/cli-plugin-typescript/lib/tslint.js
Line 60 in f8a0a63
Untyped rules will work fine with this, but some typed rules will throw. For example,
no-unsafe-any
crashes: palantir/tslint#4273Related TypeScript issue: microsoft/TypeScript#8136
This is a more general case of #2712 as originally reported by @millimoose. The bug investigation trail went from there to TSLint to TypeScript and back to here, amusingly.
The text was updated successfully, but these errors were encountered: