runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
314 stars 35 forks source link

Function and Record properties should fail no-incompatible-property-type #350

Open steverep opened 6 months ago

steverep commented 6 months ago

Properties which have a function type should fail the no-incompatible-property-type rule unless a custom converter is provided. For example, this should fail as String certainly will not result in a valid conversion:

@property() public funcProp?: () => void;

For function properties, only including a custom converter or {attribute: false} should pass the rule.

steverep commented 5 months ago

I also noticed that Record<...> types also pass with the default String converter, and they certainly should not.