I have setup eslint to warn me on unsed vars
rules: {
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
}
Now I have a typescript class which look like this:
import { User } from './user';
export class MyClass {
async myMethod(): Promise<User> {
// Some code
}
}
When I run eslint I get this error
error 'User' is defined but never used @typescript-eslint/no-unused-vars
Why is eslint warning me? In my eyes the variable is used.
question from:
https://stackoverflow.com/questions/65938767/eslint-returns-with-no-unused-vars 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…