yeonjuan / html-eslint

ESLint plugin for linting HTML
https://html-eslint.org
MIT License
161 stars 28 forks source link

Parser requires meta object #184

Closed Logicer16 closed 7 months ago

Logicer16 commented 7 months ago

When attempting to use @html-eslint/parser, eslint --cache throws an error as the parser lacks a meta object:

Error: Could not serialize parser object (missing 'meta' object).

Config (eslint.config.js):

import htmlPlugin from "@html-eslint/eslint-plugin";
export default [
  htmlPlugin.configs["flat/recommended"]
];
yeonjuan commented 7 months ago

Thanks for the report, it looks like we need to change the parser to export the meta object.

Logicer16 commented 7 months ago

Did you mean to tag this as a bug instead of an enhancement? This is a fatal error being thrown. The parser does not work in a flat config.

yeonjuan commented 7 months ago

Hi @Logicer16. I tried flat config and couldn't see any errors, could you please share your eslint version?

Did you mean to tag this as a bug instead of an enhancement? This is a fatal error being thrown.

Right, I'll change the label. Thanks!

Logicer16 commented 7 months ago

I tried flat config and couldn't see any errors

I've taken a look, it only seems to be an issue when either --cache or --print-config is used. That's probably why it wasn't noticed earlier.

yeonjuan commented 7 months ago

@Logicer16

I've taken a look, it only seems to be an issue when either --cache or --print-config is used. That's probably why it wasn't noticed earlier.

I've confirmed that the error you mentioned is reproduced! Thanks for the details. I'll fix it up and release it this weekend, but if you're planning to contribute yourself, let me know. I look forward to it.

yeonjuan commented 7 months ago

Hi @Logicer16 , It's fixed and released in @html-eslint/parser@0.24.1 , @html-eslint/eslint-plugin@0.24.1. thanks!

Logicer16 commented 7 months ago

Thank you so much! ❤️