-
Notifications
You must be signed in to change notification settings - Fork 62
[no-unused-vars] false positive with import used in type #90
Comments
I added the following test locally as a valid test case, and all tests passed: diff --git a/tests/lib/rules/no-unused-vars.js b/tests/lib/rules/no-unused-vars.js
index c470d3c..0bfc682 100644
--- a/tests/lib/rules/no-unused-vars.js
+++ b/tests/lib/rules/no-unused-vars.js
@@ -316,6 +316,13 @@ import { Another } from 'some';
interface A extends Nullable<SomeOther> {
do(a: Nullable<Another>);
}
+ `,
+ `
+import * as webpack from 'webpack';
+
+const webpackConfig: webpack.Configuration = {};
+
+return webpackConfig;
`
],
Nothing in that snippet is being reported as unused. Are you still experiencing this issue with the latest version of eslint-plugin-typescript, and if so, could you please include your ESLint config? |
closing as we are unable to reproduce, and there has been no response from OP. |
I wanted to create a new issue with the exact same title. Maybe it is better to post it here? // next line is an error
import { HTMLAttributes } from 'react';
type SomeType = HTMLAttributes<HTMLButtonElement>; |
Check your parser version. |
Oh. I am currently on |
Yes. With the v1 release we have made it possible for us to control the parser version to help prevent mismatches. We're close to the v1 release! |
How close? |
Have a look at the pinned 1.0.0 issue (#151). You can try out the RC now. |
there are still some errors in no-unused-vars and so on, we need new release of parser :) |
As you can see in the screenshot, eslint reports an error on 'webpack' while it is used in a type notation.
The text was updated successfully, but these errors were encountered: