Open NicoVogel opened 1 year ago
I am also open to contribute here, but I would need some guidance as to what configuration options should be part of the first version and if you see any trouble ahead with reusing the already existing linting rules :)
we could possibly expose the template function names as a setting...
in an eslint config file, you can have:
{
"settings": {
"some-arbitrary-setting": "whatever"
}
}
which then turns up on context.settings
.
maybe we could:
isTemplateNode(context: Context, node: ESTree.Node): node is ESTree.TaggedTemplateExpression
util to replace all the places we manually check the expression's tag name/typecontext.settings.lit.templateNames
(very safely, i.e. null check the whole thing and check that its definitely an array), which falls back to ['svg', 'html']
As far as I can see, this plugin does not further lint the
svg
function input fromlit
. But the rules that apply to thehtml
syntax should also be appliable forsvg
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 forsvg
: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: