Skip to content

Bug: [no-unused-vars] varsIgnorePattern is broken on v8 beta #9383

@ottomated

Description

@ottomated

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

CodeSandbox (your playground does not support v8)

Repro Code

try {
  throw new Error();
} catch (_) {}

ESLint Config

import js from "@eslint/js";
import ts from "typescript-eslint";

export default ts.config(
  js.configs.recommended,
  ...ts.configs.recommended,
  {
    rules: {
      "@typescript-eslint/no-unused-vars": [
        "warn",
        {
          argsIgnorePattern: "^_",
          varsIgnorePattern: "^_",
        },
      ],
    },
  },
);

tsconfig

No response

Expected Result

I expect no errors or warnings to be printed.

Actual Result

warning  '_' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

Additional Info

Using version 8.0.0-alpha.30 with eslint 9.5.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existslocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions