Skip to content

Commit

Permalink
fix: throw when using —fix with ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Apr 29, 2023
1 parent 5dd90c9 commit 6d3887d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vite-plugin-checker/src/checkers/eslint/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import chokidar from 'chokidar'
import { ESLint } from 'eslint'
import path from 'path'
import invariant from 'tiny-invariant'
import { fileURLToPath } from 'url'
import { parentPort } from 'worker_threads'

Expand Down Expand Up @@ -38,6 +39,11 @@ const createDiagnostic: CreateDiagnostic<'eslint'> = (pluginConfig) => {
if (!pluginConfig.eslint) return

const options = optionator.parse(pluginConfig.eslint.lintCommand)
invariant(
!options.fix,
'Using `--fix` in `config.eslint.lintCommand` is not allowed in vite-plugin-checker, you could using `--fix` with editor.'
)

const translatedOptions = translateOptions(options) as ESLint.Options

const logLevel = (() => {
Expand Down

0 comments on commit 6d3887d

Please sign in to comment.