Socket
Socket
Sign inDemoInstall

@nabla/vite-plugin-eslint

Package Overview
Dependencies
3
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nabla/vite-plugin-eslint


Version published
Weekly downloads
26K
increased by0.03%
Maintainers
4
Created
Weekly downloads
 

Changelog

Source

2.0.4

  • Add explicit debug dependency
  • Change ESLint peer dependency range to ^8.45 || ^9 to match the changes made to support flat config in 2.0.2

Readme

Source

@nabla/vite-plugin-eslint npm

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

Note: the fix option is only supported from 1.3.4

shouldLint

  • Type: (path: string) => boolean
  • Default: (path) => path.match(/\/src\/[^?]*\.(vue|svelte|m?[jt]sx?)$/)

You can use DEBUG=eslint node_modules/.bin/vite to debug this option (available in 1.4.0)

formatter

  • Type: string | ((result: ESLint.LintResult) => void)
  • Default: Custom format with one line per warning/error.

If provided, the value is passed to eslint.loadFormatter. Use stylish to get a CRA like output. Async formatters are supported in 1.5.0. Function support was added in 2.0.2.

Keywords

FAQs

Last updated on 17 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc