gxmari007 / vite-plugin-eslint

🚨 ESLint plugin for vite
MIT License
266 stars 44 forks source link

Does not work with react-refresh plugin #1

Closed ind-igo closed 3 years ago

ind-igo commented 3 years ago

Hey there. I just installed this plugin and when running 'yarn dev', I get this error:

6:47:40 PM [vite] Internal server error: No ESLint configuration found in /.
  Plugin: vite:eslint
  File: /@react-refresh
gxmari007 commented 3 years ago

You need .eslintrc config file in project.

ind-igo commented 3 years ago

I did have the .eslintc, which was why it was confusing. When I started using the Rollup plugin it was working (not perfectly though).

gxmari007 commented 3 years ago

You can take a look at this project https://github.com/qinghuanI/vite-react-app

Gelio commented 3 years ago

I have just encountered the same problem. The fix was to tell the plugin to not lint /@react-refresh. This can be done by either mentioning it in the exclude array:

    eslintPlugin({
      exclude: ["node_modules", "/@react-refresh"],
    }),

or having an include section with only specific files from the src directory:

    eslintPlugin({
      include: "src/**/*.{js,jsx,ts,tsx}",
    }),