79463477

Date: 2025-02-24 12:14:20
Score: 0.5
Natty:
Report link

Use tsconfig.json to define this like so:

  "compilerOptions": {
    "noUnusedLocals": true,
    "noUnusedParameters": true,

I found that its more correct to set these rules in tsconfig than eslint. This prevents you from getting errors/warnings in type definitions. E.g:

type MyType = {
  fn: (arg: string) => void;
}

Setting:

//es.config.mjs
"no-unused-vars": "warn",

This would give a warning on the arg param in the type above, while setting:

//tsconfig.json
  "compilerOptions": {
    "noUnusedLocals": true,
    "noUnusedParameters": true,

does not

Reasons:
  • Blacklisted phrase (1.5): m getting error
  • Long answer (-0.5):
  • Has code block (-0.5):
Posted by: mTv