-
What language is this for?
Vue3, TypeScript -
Which rule?
Interface has only a call signature, you should use a function type instead (typescript:S6598) -
Why do you believe it’s a false-positive/false-negative?
In Vue3, you can define compiler macros. One of them which we did earlier was instead of defining the type/interface indefineEmits
. Vue3 you can define Emits using interface
-
Are you using
- SonarQube Cloud? - YES
-
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
If you create a simple Vue3 app and define the emits as follows:
interface Emits {
(e: 'emit-a'): void;
(e: 'emit-b', param: string): void;
}
const emits = defineEmits<Emits>();
and run Sonarcloud on this code, you should get the warning for the typescript:S6598