Open zhaolinlau opened 2 years ago
Thanks for reporting this. We removed the Lint HTML files setting because all it did was add a scope to the List of scopes to run ESLint on list above, so I felt it was redundant. But I didn't do extensive testing to make sure this still worked.
Luckily, I just attempted an experiment, and it does work. Here's what I did:
eslint
and eslint-plugin-html
into the project's node_modules
folder.eslintrc
at the root of the project and included "plugins": ["html"]
index.html
and index.php
and gave them identical contents; both had a script
block with a linting errortext.html.basic
or text.html.php
— to linter-eslint-node
's package settings under List of scopes to run ESLint onI can think of three things that might be happening for you:
text.html.basic
or text.html.php
as described above. (The settings instruct you to add source.js.embedded.html
, but that will only work when the cursor is inside that scope when you save or invoke the Lint command, and that's likely not what you want. I will change those instructions.).eslintrc
exists in a directory above your project root. This is unlikely, but it is another difference between this package and linter-eslint: starting from the file that you're linting, both packages traverse upwards and use the first .eslintrc
they find, but linter-eslint-node will only go as far as the project root, whereas linter-eslint will keep going to the root of the volume if need be. One way to test this would be to lint a JavaScript file in your project; if it gets linted, then linter-eslint-node can find your .eslintrc
.eslint-plugin-html
needs to be installed either locally (in your project) or globally, not “in linter-eslint-node directory” as you state, but I think this was just an ambiguous phrasing.If you try all this and still can't get it working, please run the Linter Eslint Node: Debug command and paste the output, and also include the contents of your .eslintrc
.
Sorry, I didn't read closely enough. You say that it gives you a “No ESLint configuration found” error message, so it's most likely item 2 in my list. I'm guessing that you'd get that error in all cases, not just for HTML files.
Yes, installing eslint-plugin-html and adding .eslintrc in project root actually it's just work fine. But to be more convenient to lint projects, I'm here to request to add .eslintrc path configuration like linter-eslint package so that we don't need to setup eslint everytime. And it's just my request also as my suggestion, not forcing you guys to add it because I understand you guys have your own opinion on it too. That's all from me.
Ah, I see. I'll keep this open as a feature request; if other people ask for it, we can see about adding it back in. Thanks!
Issue Type
Question
Issue Description
May I know how to set the path of .eslintrc like linter-eslint package? Because I need to lint javascript in html & php files, and I did install the eslint-plugin-html in linter-eslint-node directory and added eslint-plugin-html to .eslintrc in that directory too. However, the linter says no eslint configuration found. Besides, linter-eslint package is just work fine with that.