yeonjuan / html-eslint

ESLint plugin for linting HTML
https://html-eslint.org
MIT License
161 stars 28 forks source link

How to run in Browser - for browser editor integration #192

Open abose opened 5 months ago

abose commented 5 months ago

Hi,

I am trying to integrate html linter into https://phcode.dev and found this repo. It is fully browser based, so i was looking for a js lib to integrate like i found in the playground.

I see that in the playground, this runs in the browser as well. However, i could not see how to load this in the browser from any of the docs. How do i run in the browser?

Thanks for building this!

yeonjuan commented 5 months ago

Hi @abose.

https://phcode.dev/

Awesome project. +1 ⭐

I see that in the playground, this runs in the browser as well. However, i could not see how to load this in the browser from any of the docs. How do i run in the browser?

This project is a plugin for ESLint. ESLint only works in the nodejs environment by default, so I created a private package called web-linter to run ESLint in the browser. To make this plugin work in the browser, you need to bundle eslint with a bundler like webpack to make it browser-compatible.

Alternatively, there are projects that already provide bundled package for using eslint in the browser.

abose commented 5 months ago

Thanks for the info. Let me try building the private package as above. Thanks again!