-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-unused-vars] More missing detections #45
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
Comments
Hi @milesj, could you please try upgrading to Also just a tip, when linking to files in your repo, instead of linking to master, link to a commit. The commit link's content won't change, but the link to master will change when you push. |
(you can hit |
For me, this snippet still reports errors on import { ExecutionResult } from 'graphql/execution/execute';
import { UnknownObject } from '../ts-utils';
export type RigelDispatch = <DataType extends UnknownObject>(
action: Action<DataType>
) => Promise<ExecutionResult<DataType>>;
|
I'll try the 1.0.0 version. |
Trying 1.0.0-rc3 and parser 22.0.0. It crashes on 2 repos with the following error:
The line in
Also noticed that the |
This is expected, there was a lot of changes in parser, and its not compatible with plugin, you have to wait for new release |
Please read #73 |
Yup, assumed that was the problem. Will report back in a week. |
Not sure if I should piggy-back off of this issue, but another false negative I'm seeing is in interface declarations, e.g.
Both https://github.com/aserra54/typescript-eslint-parser-no-unused-vars |
@aserra54 you are missing plugin https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], or atleast {
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
} and you should move |
Tested with the new import i18next from 'i18next';
export interface Translator extends i18next.i18n {} Seems to trigger on both rules.
|
I'm getting false positives on React components. // react.tsx
import * as React from 'react';
import { Heading2 } from 'some-place';
export const Comp: React.FunctionComponent = () => (
<Heading2>Some content</Heading2>
);
config: {
"extends": ["plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint"]
} (this creates a couple of more errors for rules I've turned off) |
You have to install and use eslint plugin React |
Ah! Fair enough 🙂 I've forgotten all about that plugin, gonna be awesome to be able to use it again 😅 |
Repro
Run the linter on https://github.com/milesj/beemo
Some examples of it not working:
Type index access:https://github.com/milesj/beemo/blob/master/packages/cli/src/CLI.ts#L58When an imported type is re-assigned and exported:https://github.com/milesj/beemo/blob/master/packages/core/src/types.ts#L34 AND https://github.com/milesj/beemo/blob/master/packages/core/src/types.ts#L62Imported type used in a generic intersection:https://github.com/milesj/beemo/blob/master/packages/driver-babel/src/BabelDriver.ts#L46Expected Result
They don't fail.
Actual Result
They do fail.
Additional Info
Versions
eslint-plugin-typescript
0.14.0
typescript-eslint-parser
21.0.2
typescript
3.2.2
The text was updated successfully, but these errors were encountered: