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

Does not work with Svelte

Open Jakobud opened this issue 3 years ago • 1 comments
trafficstars

I'm trying to use this with Svelte Kit by passing it to the vite plugins objects in svelte.config.js:

import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
import eslintPlugin from 'vite-plugin-eslint';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter(),
    vite: () => ({
      plugins: [
        eslintPlugin.default()    // eslintPlugin() resulted in "not a function" error
      ]
    })
  },
  preprocess: preprocess({
    scss: {
      prependData: `@import './src/scss/global.scss';`
    }
  })
};

export default config;

When I run npm run dev and continue my development I never see any linting errors in the terminal. I assume this is how I am supposed to be seeing the linting errors, correct?

If I manually run eslint from the command line I see all my lint errors as expected.

Jakobud avatar Apr 14 '22 16:04 Jakobud

It should work fine now.

gxmari007 avatar Apr 23 '22 03:04 gxmari007