From 74565609f3146cac601ed6d9237deec42bde08a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Fri, 5 Nov 2021 11:13:05 +0100 Subject: [PATCH] Fix early return bug --- README.md | 2 ++ package.json | 2 +- worker.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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) {