allow typescript compilation with no unused variable rule
Asked Answered
D

2

7

I'm using these rules in tsconfig in order to highlight unused variables and imports in vscode.

 "noUnusedLocals": true,                /* Report errors on unused locals. */

 "noUnusedParameters": true,            /* Report errors on unused parameters. */

However I would like these rules not to block compilation. Is that possible ?

Divulge answered 19/8, 2017 at 23:22 Comment(0)
S
0

You can mark them as false. So the unused variables appear as warnings. Then when you fix that you can set those variables to true

Sergiosergipe answered 4/5, 2021 at 16:35 Comment(0)
C
-1

Typescript will never block the compilation, as long as the syntax is valid. What you see are just "warnings", your javascript files are emitted.

Cyder answered 19/8, 2017 at 23:46 Comment(2)
Not true. Here's what I'm getting in a TSX file: Failed to compile. TS6133: 'e' is declared but its value is never read.Philemol
Can you give a proper example?Cyder

© 2022 - 2024 — McMap. All rights reserved.