For AI agents: the complete documentation index is available at https://vite-plugin-eslint2.modyqyw.top/llms.txt, the full documentation bundle is available at https://vite-plugin-eslint2.modyqyw.top/llms-full.txt, and this page is available as Markdown at https://vite-plugin-eslint2.modyqyw.top/guide/getting-started.md.
  • English
  • Getting Started

    Overview

    vite-plugin-eslint2 runs ESLint inside Vite. It supports Vite v2 to v8 and ESLint v7 to v10.

    The plugin needs Node.js 18 or newer. Each ESLint major has its own Node.js requirement. The table below lists them.

    For Nuxt projects, use @nuxt/eslint.

    You may also want the Vite Stylelint plugin.

    Install

    npm install vite-plugin-eslint2 -D

    vite-plugin-eslint2 does not install or configure ESLint for you. Install the ESLint major you want and the types it needs.

    ESLintInstallNode.js
    10npm install eslint@^10 -D^20.19.0 || ^22.13.0 || >=24
    9npm install eslint@^9 @types/eslint@^9 -D^18.18.0 || ^20.9.0 || >=21.1.0
    8npm install eslint@^8 @types/eslint@^8 -D^12.22.0 || ^14.17.0 || >=16.0.0
    7npm install eslint@^7 @types/eslint@^7 -D^10.12.0 || >=12.0.0

    ESLint 9.10.0 and newer ship their own types, so @types/eslint is only needed below that.

    Usage

    // vite.config.ts
    import { defineConfig } from "vite";
    import eslint from "vite-plugin-eslint2";
    
    export default defineConfig({
      plugins: [eslint()],
    });

    Acknowledge

    Initially forked from gxmari007/vite-plugin-eslint.

    Contributors

    This project was created by ModyQyW.

    Thanks to all contributors for their contributions!

    Sponsors

    If this package is helpful to you, please consider sponsoring. It keeps the project developed and maintained.