JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53455
  • Score
    100M100P100Q162059F
  • License MIT

Plugs ESLint into Vite dev server

Package Exports

  • @nabla/vite-plugin-eslint

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nabla/vite-plugin-eslint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@nabla/vite-plugin-eslint

Plugs ESLint into Vite dev server.

Differences with vite-plugin-eslint

  • Keeps HMR fast: linting is done asynchronously and doesn't block the transform process
  • Reduces noise: Display results via console logs

logs.png

Because of this, the plugin can't fail the build and is only applied in dev. Like typechecking, linting should be done before or in parallel of the build command.

Install

yarn add --dev @nabla/vite-plugin-eslint

Usage

import { defineConfig } from "vite";
import eslintPlugin from "@nabla/vite-plugin-eslint";

export default defineConfig({
  plugins: [eslintPlugin()],
});

Options

eslintOptions

  • Type: ESLint.Options
  • Default: { cache: true }

shouldLint

  • Type: (path: string) => boolean
  • Default: (path) => path.match(/.[jt]sx?$/)