When I'm writing TypeScript code in my code editor, it highlights unused imports and local variables as errors, marked with a red squiggly underline:
https://i.sstatic.net/zRJMP.png
However, I would prefer if these were shown as warnings in the editor, especially since it's common for me to not use the import/local variable immediately. The red error indication sometimes gives the impression of a more serious issue, like importing a non-existent symbol.
Previously, with tslint handling unused imports/locals, this differentiation was clearer. But now that it's part of the compiler, it's more challenging to distinguish them.
Is there a way to configure the compiler to treat these specific errors as warnings instead?
In my tsconfig.json
, I have the following setup:
{
"compilerOptions": {
"noUnusedLocals": true
}
}