BenoitZugmeyer / eslint-plugin-html

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

Incompatibility with tslint #85

Closed markus-s24 closed 6 years ago

markus-s24 commented 6 years ago

Tell us about your environment

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

Run ESLint in project which uses tslint too.

What did you expect to happen?

No failure.

What actually happened? Please include the actual, raw output from ESLint.

eslint-plugin-html looks for

const needle = path.join("lib", "linter.js")

which matches tslint's linter.js, which seems to be incompatible.

Shouldn't eslint-plugin-html look just for

const needle = path.join("eslint", "lib", "linter.js")

instead?

Failure:

Module build failed: TypeError: Cannot read property 'verify' of undefined
    at getModuleFromCache (/Users/markus/projects/sea-support/frontend/node_modules/eslint-plugin-html/src/index.js:40:31)
    at iterateESLintModules (/Users/markus/projects/sea-support/frontend/node_modules/eslint-plugin-html/src/index.js:55:20)
    at Object.<anonymous> (/Users/markus/projects/sea-support/frontend/node_modules/eslint-plugin-html/src/index.js:26:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Plugins.load (/Users/markus/projects/sea-support/frontend/node_modules/eslint/lib/config/plugins.js:101:26)
    at Array.forEach (<anonymous>)
    at Plugins.loadAll (/Users/markus/projects/sea-support/frontend/node_modules/eslint/lib/config/plugins.js:146:21)
    at loadFromDisk (/Users/markus/projects/sea-support/frontend/node_modules/eslint/lib/config/config-file.js:492:35)
    at Object.load (/Users/markus/projects/sea-support/frontend/node_modules/eslint/lib/config/config-file.js:550:20)
    at Config.getLocalConfigHierarchy (/Users/markus/projects/sea-support/frontend/node_modules/eslint/lib/config.js:228:44)
BenoitZugmeyer commented 6 years ago

Thank you for the report, I'll check this soon. I initially used "eslint/lib/..." as a needle, but the folder of ESLint may be named something else, see #27 .

qazbnm456 commented 6 years ago

Bumping into the same situation too here. I mix with tslint as well.

image

BenoitZugmeyer commented 6 years ago

This should be fixed in v4.0.2. Let me know if you still have the issue.

qazbnm456 commented 6 years ago

@BenoitZugmeyer Solved! Thanks. 😄