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;