amrsalama
(Amr Salama)
January 11, 2021, 2:49pm
1
In typescript, creating an intersection with an interface that contains a dynamic property name emits RSPEC-4335 violation: “Types without members, ‘any’ and ‘never’ should not be used in type intersections”.
SonarLint version: v1.19.0
Example
const propName = 'prop-name';
interface MyInterface {
[propName]: string;
}
interface MyOtherInterface {
prop: string;
}
type MyType = MyOtherInterface & MyInterface;
Yassin
(Yassin Kammoun)
January 22, 2021, 8:54am
2
Hello @amrsalama !
Welcome to SonarSource community.
There is indeed a bug in the implementation of the rule. I created a ticket to address this issue as soon as possible.
Thank you for reporting us this false positive.
Cheers,
Yassin
1 Like
system
(system)
Closed
April 8, 2021, 8:43am
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.