@typescript-eslint/eslint-plugin error: 'Route' is defined but never used (no-unused-vars)

后端 未结 4 951
傲寒
傲寒 2021-02-12 11:10

After eslint adds typescript check, there will be an error when the attribute variable in the class definition is Array. \"e

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 11:18

    The solution is to disable the native no-unused-vars so that only the TS one is enabled. The former is likely to be enabled if you extend a config in ESLint. Add the rules below to your ESLint config.

    "rules": {
      "no-unused-vars": "off",
      "@typescript-eslint/no-unused-vars": "error"
    }
    

提交回复
热议问题