Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jonit-dev opened this issue Aug 29, 2022 · 6 comments
Closed

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

jonit-dev opened this issue Aug 29, 2022 · 6 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@jonit-dev
Copy link

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",

    ```
 
@fatcerberus
Copy link

This sounds like an eslint issue, not a TS one?

@afc163
Copy link

afc163 commented Aug 29, 2022

trace typescript-eslint/typescript-eslint#5551

@etoah
Copy link

etoah commented Aug 29, 2022

same issue

@jonit-dev
Copy link
Author

jonit-dev commented Aug 29, 2022

trace typescript-eslint/typescript-eslint#5551

I'll try to update it here, thanks!

@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Aug 29, 2022
@Sayakie
Copy link

Sayakie commented Aug 30, 2022

Those who have the same issue after updating...

  1. Remove your node_modules and lock file(package-lock.json, yarn.lock, or pnpm-lock.yaml whatever) and then clean install.
    I tried: pnpm install -f
  2. Restart your IDE.
  3. Profit!

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

7 participants