diff --git a/README.md b/README.md index a8c1ddd..3afcb26 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ export default defineConfig({ - Type: [ESLint.Options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) - Default: `{ cache: true }` +Note: the `fix` option is only supported from `1.3.4` + ### shouldLint - Type: `(path: string) => boolean` diff --git a/package.json b/package.json index 5783626..3d31c58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nabla/vite-plugin-eslint", - "version": "1.3.3", + "version": "1.3.4", "license": "MIT", "description": "Plugs ESLint into Vite dev server", "homepage": "https://github.com/nabla/vite-plugin-eslint#readme", diff --git a/worker.js b/worker.js index 3f8e942..d18157f 100644 --- a/worker.js +++ b/worker.js @@ -15,6 +15,7 @@ parentPort.on("message", (path) => { .then(async (ignored) => { if (ignored) return; const [report] = await eslint.lintFiles(path); + if (report.output !== undefined) await fs.writeFile(path, report.output); if (report.messages.length === 0) return; if (formatterPromise) { const formatter = await formatterPromise; @@ -31,7 +32,6 @@ parentPort.on("message", (path) => { ); }); } - if (report.output !== undefined) await fs.writeFile(path, report.output); }) .catch((e) => { if (e.messageTemplate === "file-not-found" && e.messageData?.pattern) {