BenoitZugmeyer / eslint-plugin-html

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

Plugin very slow in not particularly complex case #102

Closed edg2s closed 6 years ago

edg2s commented 6 years ago

Linting this file with our current ruleset takes 12 seconds:

https://github.com/wikimedia/VisualEditor/blob/master/demos/ve/desktop.html

Larger JS files take fractions of a second.

BenoitZugmeyer commented 6 years ago

Thank you for pointing this out. This was because the file has a lot of script tags, and the plugin did run the whole ESLint process on every tags, even if they were empty. eslint-plugin-html now ignores script with src attributes, it should fix your issue.

BenoitZugmeyer commented 6 years ago

I published the fix in v4.0.6, cheers! :tada:

edg2s commented 6 years ago

Thanks, will test it out.

edg2s commented 6 years ago

Much better, thanks!