Skip to content

TS 4.8.2 vs Eslint (no-unused-vars bug) #50500

@jonit-dev

Description

@jonit-dev

Bug Report

Hey there!

After updating my typescript from 4.7.4 to 4.8.2 some eslint issues started to pop-up, regarding the "no-unused-vars" rule.

image

Note that it also detects the "provide" import as unused, but its being used as a decorator a couple of lines later.

🔎 Search Terms

ts 4.8.2 eslint

🕗 Version & Regression Information

Versions that came after 4.7.4

  • This changed between versions 4.7.4 and 4.8.2

💻 Code

For a better, context, this is my:

  • eslintrc.json
{
  "env": {
    "es2021": true,
    "es6": true,
    "node": true,
    "jest": true
  },
  "extends": ["standard", "plugin:promise/recommended"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 12,
    "sourceType": "module"
  },

  "plugins": ["@typescript-eslint", "unused-imports", "promise"],
  "rules": {
    "semi": ["warn", "always"],
    "quotes": ["warn", "double", { "avoidEscape": true }],
    "comma-dangle": "off",
    "no-trailing-spaces": "off",
    "no-multiple-empty-lines": "off",
    "no-unused-expressions": "off",
    "padded-blocks": "off",
    "keyword-spacing": "off",
    "camelcase": "off",
    "require-await": "error",
    "no-case-declarations": "off",
    "object-curly-spacing": "off",
    "space-before-function-paren": "off",
    "no-useless-constructor": "off",
    "@typescript-eslint/explicit-function-return-type": "error",
    "eslint-no-use-before-defining": "off",
    "no-use-before-define": "off",
    "no-var": "error",
    "no-unused-vars": "warn",
    "@typescript-eslint/naming-convention": [
      "error",
      {
        "selector": "interface",
        "format": ["PascalCase"],
        "custom": {
          "regex": "^I[A-Z]",
          "match": true
        }
      }
    ],
    "indent": "off",
    "no-new": "off"
  }
}

package.json

 "eslint": "^7.13.0",
    "eslint-config-standard": "^16.0.1",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^5.1.0",
    "eslint-plugin-unused-imports": "^1.0.1",
    ...
    ...
  "@typescript-eslint/eslint-plugin": "^5.31.0",
    "@typescript-eslint/parser": "^5.31.0",

    ```
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy