You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
noImplicitOverride reports in JS files with checkJs enabled, can only ts-ignore the lineΒ #45591
In my projects, I set checkJs to enforce that our non-TS files also typecheck. We also use the noImplicitOverride rule.
But, if you try to create a class with method overrides in JS files, you get the override errors, even though there doesn't appear to be a way to silence them except via // @ts-ignore.
π Expected behavior
noImplicitOverride is not reported in JS files (or, there's some JSDoc way to add it, like types can be).
A quick fix like the ones for inferring types would be nice. Right now, all that's suggested is to add an ignore. (Not sure if those go here or vscode.)
AFAIK, TypeScript does not have good enough tools to handle jsdoc/comments yet. It's hard to add a jsdoc tag to something if there's already exists leading comments.
This member must have a leading JSDoc comment with an '@override' tag because it overrides a member in the base class 'Foo'.
TypeScript does not have good enough tools to handle jsdoc/comments yet. It's hard to add a jsdoc tag to something if there's already exists leading comments.
This is a good point. We would accept a PR that doesn't include a quick fix, but maybe Nathan also has some ideas there.
Activity
DanielRosenwasser commentedon Aug 27, 2021
You can add a JSDoc
/** @override */tag to get around this. The error message should be clearer in these cases.jakebailey commentedon Aug 27, 2021
A quick fix like the ones for inferring types would be nice. Right now, all that's suggested is to add an ignore. (Not sure if those go here or vscode.)
Kingwl commentedon Aug 27, 2021
AFAIK, TypeScript does not have good enough tools to handle jsdoc/comments yet. It's hard to add a jsdoc tag to something if there's already exists leading comments.
a-tarasyuk commentedon Aug 30, 2021
The issue is labeled "Domain: Error Messages". What should be the expected error message?
/cc Daniel Rosenwasser (@DanielRosenwasser)
DanielRosenwasser commentedon Aug 30, 2021
Nathan Shively-Sanders (@sandersn) might have opinions but
This is a good point. We would accept a PR that doesn't include a quick fix, but maybe Nathan also has some ideas there.
Kingwl commentedon Aug 31, 2021
Here's a PR to try to add quickfix support in js file. https://github.com/Kingwl/TypeScript/pull/8/files.
sandersn commentedon Sep 3, 2021
I believe inferFromUsage has code for this.
DanielRosenwasser commentedon Sep 3, 2021
Wenlu Wang (@Kingwl) see if there's anything there you might be able to leverage for your current work, and let us know if you run into any issues.
Kingwl commentedon Sep 4, 2021
I guess it's might helpful to Kevin Tan (@stkevintan).