
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
vite-plugin-linter
Advanced tools
Vite plugin to lint files and show the linter output in the Vite output and the browser console.
The main difference between this plugin and using similar Rollup plugins is that this plugin shows the output in the browser console.
Note this plugin is Vite only as it uses the Vite specific hook configureServer.
Included linters: ESLint & TypeScript
npm install vite-plugin-linter --save-dev
import { defineConfig } from "vite";
import { EsLinter, linterPlugin, TypeScriptLinter } from "vite-plugin-linter";
export default defineConfig((configEnv) => ({
plugins: [
linterPlugin({
include: ["./src/**/*.ts", "./src/**/*.tsx"],
linters: [new EsLinter({ configEnv: configEnv }), new TypeScriptLinter()],
}),
],
}));
import { defineConfig } from "vite";
import { EsLinter, linterPlugin, TypeScriptLinter } from "vite-plugin-linter";
export default defineConfig((configEnv) => ({
plugins: [
linterPlugin({
include: ["./src/**/*.ts", "./src/**/*.tsx"],
linters: [
new EsLinter({
configEnv: configEnv,
serveOptions: { clearCacheOnStart: true },
}),
new TypeScriptLinter(),
],
build: {
includeMode: "filesInFolder",
},
}),
],
}));
booleanfalseIf the plugin should not execute when called via the build/serve command
"processedFiles" | "filesInFolder"processedFilesWhich files to lint when called via the build/serve command
processedFiles lints only the files processed by Vite
filesInFolder lints all files in the project folder
String | RegExp | Array[...String|RegExp]/node_modules/File(s) to exclude. A valid picomatch pattern, or array of patterns. Ex: .\src\mine.ts
String | RegExp | Array[...String|RegExp]undefinedFile(s) to include. A valid picomatch pattern, or array of patterns. Ex: .\src\**\*.ts
stringFile to inject the browser console logging code into
Linter[]Linters to run
EsLintOptionscache: false, fix: falseOptions used when called via the build command
ConfigEnvThe current Vite configuration environment
EsLintOptionscache: true, cacheLocation: "./node_modules/.cache/.eslintcache", fix: falseOptions used when called via the serve command
This type extends ESLint.Options with the following additional members
booleanfalseIf the cache file should be removed before each start
string | ESLint.FormatterstylishOutput formatter https://eslint.org/docs/user-guide/formatters/
This type extends ts.CompilerOptions with the following additional member
stringtsconfig.jsonPath to the TypeScript config file
A node script that executes the configured linters is included that can be run via npm, for example, in package.json: "scripts": { "lint": "vite-plugin-linter" }. A example of where this could be used is in a Git pre-commit hook. The includeMode option is always filesInFolder when running via this script.
Custom linters can be created by extending the Linter interface
See the included linters for examples
Submit bug reports and other feedback in the issues section
MIT
FAQs
Plugin for linting files with Vite
The npm package vite-plugin-linter receives a total of 8,511 weekly downloads. As such, vite-plugin-linter popularity was classified as popular.
We found that vite-plugin-linter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.