Skip to content

[no-unused-vars] false positives for code inside declare blocks #2844

@kripod

Description

@kripod
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/no-unused-vars": "warn"
  }
}
import "next-auth";

declare module "next-auth" {
  interface User {
    id: string;
    givenName: string;
    familyName: string;
  }
}
import { PrismaClient } from "@prisma/client";

// Namespace declarations are also problematic
declare namespace globalThis {
  let prisma: PrismaClient; // Value can be anything else
}

Expected Result

No warnings should be emitted.

Actual Result

Invalid warnings are emitted inside declare blocks, unlike in v4.8.

Versions

package version
@typescript-eslint/eslint-plugin 4.9.0
@typescript-eslint/parser 4.9.0
TypeScript 4.1.2
ESLint 7.14.0
node 14.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: 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

      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