Add documentation for using HTML ESLint with other HTML-processing plugins #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users need to configure HTML ESLint alongside other plugins like
eslint-plugin-htmlto lint both HTML syntax and inline JavaScript, but ESLint's parser architecture prevents using both in a single config file. This creates confusion and undocumented workarounds.Changes
Documentation
docs/using-with-other-plugins.mdexplaining the parser conflict and solutionIntegration
Example Configuration
Run both:
eslint --config eslinthtml.config.mjs "**/*.html" && eslint --config eslintjs.config.mjs "**/*.html"Resolves #108, #211
Original prompt
This section details on the original issue you should resolve
<issue_title>feature_request(docs): configuring HTML ESLint with other plugins for HTML files</issue_title>
<issue_description>Related issues — #108, #211
1. Summary
It would be helpful if HTML ESLint documentation will contain information on how users should configure HTML ESLint if they use other ESLint plugins for HTML files like eslint-plugin-html.
2. Argumentation of the need of the documentation improvements
I created the additional configuration file
eslinthtml.config.mjsfor HTML ESLint and additionally need launching ESLint with the argument--config—eslint --config eslinthtml.config.mjs. I can’t configure HTML ESLint and eslint-plugin-html both in a single fileeslint.config.mjs. Due to the ESLint discussion #18808 opened by @yeonjuan and issues #14286 and #17655 it’s not possible and not planned. If it’s possible, please show me what I need to change in my MCVE (the item 4.3.1 of this issue).Whether it’s possible or not, setting the HTML ESLint configuration may take a lot of time. Documentation improvements can significantly reduce the time needed for setting.
3. MCVE
3.1. Installation
3.2. HTML file for testing
KiraExample.html:4. Configurations
4.1. Solely for HTML ESLint
4.1.1. Configuration file
eslinthtml.config.mjs:4.1.2. CLI command
4.1.3. Behavior
Expected. ESLint returns HTML ESLint’s errors.
4.2. Solely for eslint-plugin-html
4.2.1. Configuration file
eslintjs.config.mjs:4.2.2. CLI command
4.2.3. Behavior
Expected. ESLint returns JavaScript errors in the HTML file.
4.3. Merged configuration
4.3.1. Configuration file
eslint.config.mjs: