gxmari007 / vite-plugin-eslint

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

Does not work with Svelte #26

Closed Jakobud closed 1 year ago

Jakobud commented 2 years ago

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.

gxmari007 commented 2 years ago

It should work fine now.