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

[no-unused-vars] is not correct in d.ts files #2300

Closed
Mister-Hope opened this issue Jul 15, 2020 · 1 comment
Closed

[no-unused-vars] is not correct in d.ts files #2300

Mister-Hope opened this issue Jul 15, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@Mister-Hope
Copy link

Repro

extends:
  - eslint:recommended

overrides:
  - files:
      - "*.ts"

    extends:
      - plugin:@typescript-eslint/eslint-recommended
      - plugin:@typescript-eslint/recommended
      - plugin:@typescript-eslint/recommended-requiring-type-checking

    plugins:
      - "@typescript-eslint"

    parserOptions:
      parser: "@typescript-eslint/parser"
      project:
        - "./tsconfig.json"
        - "./test-tsconfig.json"

shims-tsx.d.ts:

import Vue, { VNode } from "vue";

declare global {
  namespace JSX {
    type Element = VNode;
    type ElementClass = Vue;
    interface IntrinsicElements {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      [elem: string]: any;
    }
  }
}

Expected Result

Actual Result

warning: 'Vue' is defined but never used (@typescript-eslint/no-unused-vars) at src\typings\shims-tsx.d.ts:1:8:
> 1 | import Vue, { VNode } from "vue";
    |        ^
  2 |
  3 | declare global {
  4 |   namespace JSX {


warning: 'VNode' is defined but never used (@typescript-eslint/no-unused-vars) at src\typings\shims-tsx.d.ts:1:15:
> 1 | import Vue, { VNode } from "vue";
    |               ^
  2 |
  3 | declare global {
  4 |   namespace JSX {

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 3.6.1
@typescript-eslint/parser 3.6.1
TypeScript 3.9.6
ESLint 7.4.0
node 12.18.2
npm
yarn 1.22.4
@Mister-Hope Mister-Hope added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jul 15, 2020
@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for maintainers to take a look labels Jul 15, 2020
@bradzacher
Copy link
Member

Please use the search before filing new issues
#2292, #2026, #2287, #1678, #1596, #1302, etc.

https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+%22no-unused-vars%22+global+

Also please read the pinned issues before filing new issues - #1856

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants