43081j / 43081j/eslint-plugin-lit

Linting svg tag function input

Abierto
#152 2 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
138
Forks
26
Merge medio
23 h 29 min
PR fusionados (30 d)
4

Descripción

As far as I can see, this plugin does not further lint the `svg` function input from `lit`.
But the rules that apply to the `html` syntax should also be appliable for `svg` from my point of view.

When looking at the code, then it seems to me that getting it to work at all, would require to not only check for `html`, but also for `svg`:
```ts
if (
node.type === 'TaggedTemplateExpression' &&
node.tag.type === 'Identifier' &&
['svg', 'html'].some(tag => tag === node.tag.name)
) {
```

Of course there is more to it, as it should be configurable if a rule should apply for both or only one.
Furthermore, I have not tested it, so this might not even work.

Is there any interest in extending `eslint-plugin-lit` to also lint code like:
```
const createElement = (chars: string): SVGTemplateResult => svg`
${chars}
`;
```
> source: https://lit.dev/tutorials/svg-templates/

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.