Closed bondom closed 6 years ago
@mightyiam Sorry, but this doesn't work
I think the error you’re encountering is a TypeScript error, and you have to use // @ts-ignore
to silence it.
I recognize this line format: [ts] 'a' is declared but its value is never read.
from VS Code. It seems like a TypeScript error, indeed. Otherwise, it would say [eslint]...
, or so.
@j-f1 @mightyiam If this is TypeScript error, it should be controlled by compiler options intsconfig.json
, right?
There is my tsconfig.json:
{
"compilerOptions": {
"baseUrl": "./",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"allowUnusedLabels": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", ".tmp", "dist", "preprod"]
}
Also when I run tsc --noEmit --p ./tsconfig.json
I get no errors.
So I think it is not related to tsconfig.json
When I deleted "no-unused-vars": "warn",
from my .eslintrc
file, project was successfully compiled, but vscode still shows this warning
noUnusedLocals: false
is it. Yet, if you're getting this error in your editor, it probably means that your editor is not reading the tsconfig.json
or so.
@mightyiam Yes! You are right! My TSLint extension was turned off
Thanks to all!
What version of TypeScript are you using? 2.7.1
What version of
typescript-eslint-parser
are you using? 14.0.0What code were you trying to parse?
What did you expect to happen? I expect to see clear code without warning
What happened? I see warning:
[ts] 'a' is declared but its value is never read.
But If I replace
// eslint-disable
with@ts-ignore
everything works fine.Is there way to disable rules with eslint-disable but not ts-ignore?