question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Differentially treat specific blocks (use new processor API)

See original GitHub issue

Description

#123 ties into this (and perhaps could be considered with this), though that issue is focused on inline event handler blocks, and this issue is more for the blocks that are already discovered by eslint-plugin-html (though supporting their differential treatment).

If supporting the new ESLint processor API, (as eslint-plugin-markdown is now doing in their v2.0.0), this should I think allow eslint-plugin-html to support the following:

  1. Applying specific overrides config (rules, etc.) for specific script tags
  2. type="module" on the script tags could be used to determine whether the blocks are modules or not (rather than project parserOptions.sourceType config) they should be weaved together for purposes of undefined/unused variables (since files can have a mix of type or no type).

(Of course, one would only wish to do this if the current beneficial ability to treat the blocks as tied together for purposes of undefined/used variables could be continued when non-module scripts were in use. If necessary, perhaps the non-modules could be strung together even if it means they could not have separate config, while allowing the modules to be treated as the separate entities they are.)

Alternatives

One can use external files and lint those by file name.

Additional context

See:

I’ll admit this is not a burning need I have, but I figured it might be worth a look given ESLint’s support for the approach, and that the Markdown plugin is now doing so.

Thanks for the great plug-in!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Airkrocommented, Apr 12, 2022

@brettz9

I want to send a PR to https://github.com/BenoitZugmeyer/eslint-plugin-html, but it’s difficult for me. let’s see if anyone can help?

I try to read the code of eslint-plugin-html, it’s really complex, I didn’t understand every part yet. And I think htmlparser2 APIs are not friendly enough.

But I will try to solute the no-unused-vars problem someday.

1reaction
JounQincommented, Apr 22, 2021

@BenoitZugmeyer

Are you working on this? It should not be difficult based on my experience by fixing eslint-plugin-markdown’s issues and developing eslint-plugin-mdx, and fixing other tools’ issues due to processor API.

If you haven’t started, I can help to start the job when I’m free.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka Streams Processor API | Confluent Documentation
With the Processor API, you can define arbitrary stream processors that processes one received record at a time, and connect these processors with...
Read more >
Processor API - Apache Kafka
With the Processor API, you can define arbitrary stream processors that processes one received record at a time, and connect these processors with...
Read more >
Kafka Streams for Stream processing - Serban Balamaci
To write data into Kafka it's pretty simple using the Java Kafka client api. A record / message consists of a Key and...
Read more >
Block Device Drivers — The Linux Kernel documentation
Overview¶. Block devices are characterized by random access to data organized in fixed-size blocks. Examples of such devices are hard drives, CD-ROM drives, ......
Read more >
Chapter 6 Physical Page Allocation - The Linux Kernel Archives
Chapter 6 Physical Page Allocation. This chapter describes how physical pages are managed and allocated in Linux. The principal algorithmm used is the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found