-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@html-eslint/parser
doesn't support eslint-plugin-tailwindcss
#211
Comments
Hi @LatenPath Can you share the configuration? |
"devDependencies": {
"@angular-eslint/template-parser": "^18.3.0",
"@html-eslint/eslint-plugin": "^0.26.0",
"@html-eslint/parser": "^0.26.0",
"eslint": "^9.9.0",
"eslint-plugin-tailwindcss": "^3.17.4",
"tailwindcss": "^3.4.10",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0"
}
import eslintHTML from "@html-eslint/eslint-plugin";
import eslintTypescript from "typescript-eslint";
import eslintTailwindCSS from "eslint-plugin-tailwindcss";
import eslintHTMLParser from "@html-eslint/parser";
import eslintAngularParser from "@angular-eslint/template-parser";
export default eslintTypescript.config(
//
// HTML plugin configs
{
"files": [ "**/*.html" ],
"languageOptions": {
parser: eslintHTMLParser,
},
"plugins": {
"@html-eslint": eslintHTML,
},
"rules": {
"@html-eslint/require-doctype": 1 // For testing
}
}
// The above code will run fine alone, below is the code used to run TailwindCSS Eslint
// (**will cause 'TypeError: Cannot read' error, but will run fine without the above code**)
// {
// "files": [ "**/*.html" ],
// "languageOptions": {
// parser: eslintAngularParser,
// },
// "plugins": {
// "tailwindcss": eslintTailwindCSS,
// },
// "rules": {
// "tailwindcss/classnames-order": [ 1 ] // For testing
// },
// },
// I tried to combine them, but this one will cause an error too:
// {
// "files": [ "**/*.html" ],
// "languageOptions": {
// parser: eslintHTMLParser,
// },
// "plugins": {
// "@html-eslint": eslintHTML,
// "tailwindcss": eslintTailwindCSS,
// },
// "rules": {
// "@html-eslint/require-doctype": 1,
// "tailwindcss/classnames-order": [ 1 ],
// },
// },
//
); TailwindCSS Eslint Github link: https://github.com/francoismassart/eslint-plugin-tailwindcss |
@LatenPath It would be great if you could also share the contents of the HTML file you ran the lint on to reproduce the error. |
I'm using
html-eslint
and it works fine:But, then I want to use
eslint-plugin-tailwindcss
to lint tailwind elements.It works. But, as you can see, I need to use
@angular-eslint/template-parser
for HTML file to make Tailwind-eslint worked.And as I know so far, I'm not able to use both
@angular-eslint/template-parser
and@html-eslint/parser
at the same time.I wonder if I can do something to solve this problem? I would love some advice, thank you all very much.
The text was updated successfully, but these errors were encountered: