BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
430 stars 51 forks source link

Can use it in the browser? #132

Closed iliakan closed 4 years ago

iliakan commented 4 years ago

Hi,

I'm using ESLint in the browser.

Like this:

import {Linter} from 'eslint/lib/linter/linter'; 
new Linter().verify(...code..., config, 'myfile.html');

Can I use eslint-plugin-html in the browser environment?

How do I attach it? I see node.js specific stuff, such as require.resolve in the sources.

iliakan commented 4 years ago

Looks like a rework is needed for that.

Maybe use <template> element for HTML "parsing".

BenoitZugmeyer commented 4 years ago

No, this can't be run in the browser. This plugin is hacking into node cache to patch ESLint functions. This can't work in the browser, I'm sorry.