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

后端 未结 4 941
傲寒
傲寒 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条回答
  •  爱一瞬间的悲伤
    2021-02-12 11:34

    Updated Answer

    Disable no-unused-vars and enable it with "@typescript-eslint/no-unused-vars": "error"

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

    Thanks to James Middleton for the correct answer.

    Outdated

    Looking at the eslint repository on github, there have been lots of issues opened about the no-unused-vars rule. Here is some examples:

    https://github.com/typescript-eslint/typescript-eslint/issues/45

    https://github.com/typescript-eslint/typescript-eslint/issues/111

    https://github.com/typescript-eslint/typescript-eslint/issues/171

    It's an ongoing problem. Hopefully we can expect this to be resolved soon.

提交回复
热议问题