The Wayback Machine - https://web.archive.org/web/20201121133058/https://github.com/developit/htm/issues/183
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

[Feature request] ESLint plugin #183

Open
Fordi opened this issue Oct 22, 2020 · 1 comment
Open

[Feature request] ESLint plugin #183

Fordi opened this issue Oct 22, 2020 · 1 comment

Comments

@Fordi
Copy link

@Fordi Fordi commented Oct 22, 2020

For the most part this just works, but functions within tagged markup get weird indent assertions, e.g.,

        ${collection.map((item) => {
          const { prop1, prop2 } = workWith(item);  // eslint: expected indentation of 4 but found 10 (indent)
          return html`  // eslint: expected indentation of 4 but found 10 (indent)
            <${Widget} prop1=${prop1} prop2=${prop2} />
          `;
        })} // eslint: expected indentation of 2 but found 8 (indent)

So I'd request an eslint plugin where you could specify the name of the template function, and make the linter comprehend it, or directions to the resources I'd need to implement one.

@Fordi
Copy link
Author

@Fordi Fordi commented Oct 22, 2020

I found eslint-plugin-lit, which works, albeit by disabling lit/binding-positions (👍 ) and lit/no-invalid-html (😢 ). It doesn't fix the indent comprehension, though. If anyone has any further tips, I'd love to hear 'em.

@Fordi Fordi closed this Oct 22, 2020
@Fordi Fordi reopened this Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.