eslint-plugin-jsonc icon indicating copy to clipboard operation
eslint-plugin-jsonc copied to clipboard

Error importing this plugin in Vite application

Open giacomorebonato opened this issue 1 year ago • 2 comments

Hi and many thanks for creating this plugin, it's very useful to me!

I am trying to run this plugin in the browser using Vite and eslint4b, but I am getting an error when I import it:

[ERROR] Could not read from file: /Users/grebonato/Code/mino-lint/virtual:eslint4b_eslint

node_modules/eslint-plugin-jsonc/dist/utils/index.js:117:37:
  117 │         ruleMap = map = new (require("eslint").Linter)().getRules();

Here is the repository with the error. It's a Vite project and I am using vite-plugin-eslint4b to load eslint.

Do you know what's going on? I tried to figure out by looking at how you created the playground, but I am missing something.

giacomorebonato avatar Feb 28 '23 20:02 giacomorebonato

I think this plugin is still not bundled well by Vite. The playground for this plugin still uses vuepress v1 and is internally bundled by webpack.

ota-meshi avatar Mar 01 '23 01:03 ota-meshi

Thanks for quick feedback. I'll see if I can bring any help on this side.

giacomorebonato avatar Mar 01 '23 08:03 giacomorebonato