Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting directive to undefined #342

Open
nmattia opened this issue Jan 8, 2024 · 0 comments
Open

Allow setting directive to undefined #342

nmattia opened this issue Jan 8, 2024 · 0 comments

Comments

@nmattia
Copy link

nmattia commented Jan 8, 2024

I often set a directive as potentially undefined:

`<hgroup
      ${shouldDoSomething ? ref(() => doSomething()) : undefined}
  >...</hgroup>
`

lit-analyzer flags this as incorrect:

    Type 'DirectiveResult<DirectiveClass> | undefined' is not a Lit 2 directive'
    ...
    no-incompatible-type-binding

is this use case really incorrect? In practice it seems that lit is happy with it and just drops the directive. This is much simpler than e.g. writing two different hgroups above (with only the directive being different between the two) and using one or the other.

nmattia added a commit to dfinity/internet-identity that referenced this issue Jan 8, 2024
This adds a lit-analyzer lint check. This ensures we make correct use of
lit templates.

We disable three rules which currently appear to be overrestrictive:
* runem/lit-analyzer#341
* runem/lit-analyzer#342
* runem/lit-analyzer#343
nmattia added a commit to dfinity/internet-identity that referenced this issue Jan 8, 2024
This adds a lit-analyzer lint check. This ensures we make correct use of
lit templates.

We disable three rules which currently appear to be overrestrictive:
* runem/lit-analyzer#341
* runem/lit-analyzer#342
* runem/lit-analyzer#343
github-merge-queue bot pushed a commit to dfinity/internet-identity that referenced this issue Jan 8, 2024
This adds a lit-analyzer lint check. This ensures we make correct use of
lit templates.

We disable three rules which currently appear to be overrestrictive:
* runem/lit-analyzer#341
* runem/lit-analyzer#342
* runem/lit-analyzer#343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant