Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: [no-deprecated] should allow ignoring of deprecated value #10660

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

Open
4 tasks done
kirkwaiblinger opened this issue Jan 15, 2025 · 0 comments · May be fixed by #10670
Open
4 tasks done

Bug: [no-deprecated] should allow ignoring of deprecated value #10660

kirkwaiblinger opened this issue Jan 15, 2025 · 0 comments · May be fixed by #10670
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@kirkwaiblinger
Copy link
Member

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://main--typescript-eslint.netlify.app/play/#ts=5.3.3&fileType=.tsx&code=PQKhAIAEBMFMAcBOsDGBDALra4TAFAoD2AdgM4bhxKqbYBqaANgK6zgC84ALAEwDchUhXAAjNIk5UEydFmiNWsfkA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oBNFjpEZAIb5E3dGADa4bDgDuQ6E0gAaGbKyzskIfHgc5E6Vq2aTsyADNoHALYSrlJKvXmcTIbcQPe-QSLEANV1Yb1cTAF9w7ABdaKjZOIgoiKA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

/** @deprecated */
const deprecatedValue = 42;
const bar = deprecatedValue;

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/no-deprecated": [
      "warn",
      {
        "allow": [
          {
            "from": "file",
            "name": "deprecatedValue"
          }
        ]
      }
    ]
  }
}

tsconfig

{
  "compilerOptions": {
    "strictNullChecks": true
  }
}

Expected Result

No linter report on deprecatedValue since it's configured to be allowed

Actual Result

Linter report on deprecatedValue

Additional Info

This is basically just that TypeOrValueSpecifier is only used for Types right now. Relates to #10585 (review)

@kirkwaiblinger kirkwaiblinger added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jan 15, 2025
@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants