8000 [no-unused-vars] v4 false positive: in d.ts files · Issue #2456 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

[no-unused-vars] v4 false positive: in d.ts files #2456

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

Closed
3 tasks done
doberkofler opened this issue Sep 1, 2020 · 0 comments · Fixed by #2496
Closed
3 tasks done

[no-unused-vars] v4 false positive: in d.ts files #2456

doberkofler opened this issue Sep 1, 2020 · 0 comments · Fixed by #2496
Assignees
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@doberkofler
Copy link
Contributor
  • 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

module.exports = {
	parser: '@typescript-eslint/parser',
	parserOptions: {
		project: './tsconfig.json'
	},
	extends: [
		'eslint:recommended',
		'plugin:@typescript-eslint/recommended',
		'plugin:@typescript-eslint/recommended-requiring-type-checking',
	],
	rules: {
		'@typescript-eslint/explicit-function-return-type': 'off',
		'@typescript-eslint/indent': ['warn', 'tab'],
	}
};

foo.d.ts:

interface Foo {
	foo: boolean,
}
{
  "compilerOptions": {
    "allowJs": true,
    "checkJs": false,
    "outDir": "./dist",
    "outFile": "./dist/index.js",
    "moduleResolution": "node",
    "target": "es5",
    "module": "system",
    "sourceMap": true,
    "baseUrl": "./"
  },
  "compileOnSave": false,
  "include": [
    "*"
  ],
  "exclude": [
    "node_modules"
  ]
}

Expected Result

in a d.ts file all interfaces are implicitly exported and therefore 'used'

Actual Result

1:11 warning 'Foo' is defined but never used @typescript-eslint/no-unused-vars

✖ 1 problem (0 errors, 1 warning)

Additional Info

no

Versions

package version
@typescript-eslint/eslint-plugin 4.0.1
@typescript-eslint/parser 4.0.1
TypeScript 4.0.2
ESLint 7.8.0
node 14.8.0
@doberkofler doberkofler added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Sep 1, 2020
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for team members to take a look labels Sep 1, 2020
@bradzacher bradzacher added the has pr there is a PR raised to close this label Sep 6, 2020
@bradzacher bradzacher self-assigned this Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants
0