Repository navigation
noImplicitOverride reports in JS files with checkJs enabled, can only ts-ignore the lineย #45591
Description
Activity
DanielRosenwasser commented
on Aug 27, 2021 MemberMore actionsYou can add a JSDoc
/** @override */tag to get around this. The error message should be clearer in these cases.- addedBugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHelp WantedYou can do thisYou can do this
on Aug 27, 2021 jakebailey commented
on Aug 27, 2021 MemberAuthorMore actionsA 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.)
- addedDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
on 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.
Reacted by Daniel Rosenwassera-tarasyuk commented
on Aug 30, 2021 ContributorMore actionsThe issue is labeled "Domain: Error Messages". What should be the expected error message?
DanielRosenwasser commented
on Aug 30, 2021 MemberMore actionsWhat should be the expected error message?
Nathan Shively-Sanders (@sandersn) might have opinions but
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.
Here's a PR to try to add quickfix support in js file. https://github.com/Kingwl/TypeScript/pull/8/files.
Reacted by Kevin TanIt's hard to add a jsdoc tag to something if there's already exists leading comments.
I believe inferFromUsage has code for this.
Reacted by Daniel RosenwasserDanielRosenwasser commented
on Sep 3, 2021 MemberMore actionsWenlu 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.
I guess it's might helpful to Kevin Tan (@stkevintan).
- locked as resolved and limited conversation to collaborators
on Oct 21, 2025
Bug Report
๐ Search Terms
override checkjs jsdoc
๐ Version & Regression Information
โฏ Playground Link
Playground Link
๐ป Code
๐ Actual behavior
In my projects, I set
checkJsto enforce that our non-TS files also typecheck. We also use thenoImplicitOverriderule.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
noImplicitOverrideis not reported in JS files (or, there's some JSDoc way to add it, like types can be).