lit-analyzer
lit-analyzer copied to clipboard
The `ifDefined` directive should return a non-null type, not just non-`undefined`.
The return type of ifDefined
is determined with a special rule here:
https://github.com/runem/lit-analyzer/blob/92c084da4d33d6fbdd8b29603d2003387e65dbb3/packages/lit-analyzer/src/lib/rules/util/directive/get-directive.ts#L45-L63
But the analyzer doesn't realize that the return type can't be null
in Lit 2, because it only removes undefined
(matching Lit 1's behavior):
https://github.com/runem/lit-analyzer/blob/92c084da4d33d6fbdd8b29603d2003387e65dbb3/packages/lit-analyzer/src/lib/rules/util/directive/get-directive.ts#L52