BenoitZugmeyer / eslint-plugin-html

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

Definition for rule '__eslint-plugin-html-declare-variables' was not found #82

Closed zo0ok closed 6 years ago

zo0ok commented 6 years ago

This is a strange one. No problem with eslint=v4.6.1 and eslint-plugin-html=v3.2.1. Problem with eslint=v4.11.0 and eslint-plugin-html=4.0.0

This is what happens:

$ eslint -c ~/eslint-conf.js --ext .js,.html .

........./index.js
  1:1  error  Definition for rule '__eslint-plugin-html-declare-variables' was not found  __eslint-plugin-html-declare-variables

✖ 1 problem (1 error, 0 warnings)

The problem does not happen if check html and js separately:

$ eslint -c ~/eslint-conf.js --ext .js .
$ eslint -c ~/eslint-conf.js --ext .html .

This file causes the problems:

<html>
<head><title>Test</title></head>
<body>
<b>Hi</b> Tjoho
</body>
</html>

However, if I add

<script>console.log('Hi');</script>

to it, the problem disappears.

Even weirder, I run eslint on several projects (directories). If I place the little offending file above in another project directory, it does not trigger the error (regardless whether the "new" project already has 0 or 60 files failing the same way).

It seems to be something not being properly initiated, perhaps in eslint itself rather than eslint-plugin-html, I think.

Let me know if I can provide anything else to help.

BenoitZugmeyer commented 6 years ago

Thank you for the report, definitely an issue, I'll check this soon.

BenoitZugmeyer commented 6 years ago

Fixed and released, it should be better!

zo0ok commented 6 years ago

Got 4.0.1. It is good! Thanks.