Skip to content

Commit

Permalink
Fix early return bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Nov 5, 2021
1 parent 5c163d6 commit 7456560
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion 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",
Expand Down
2 changes: 1 addition & 1 deletion worker.js
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 7456560

Please sign in to comment.