Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

How to catch unused variables with husky precommit

$
0
0

In my react/typescript project, I used no-unused-variable rule with tslint. So if there are no unused variables or imports it will block the commit. Now it says that, it has been deprecated and use noUnusedLocals and **noUnusedParameters* in tsconfig file.

I used it like this.

"compilerOptions": {

    "target": "es6",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    // other rules

}

Now the unused variables are highlighted as warnings, but the precommit cannot catch them.

How can I fix this?


Viewing all articles
Browse latest Browse all 6208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>