Skip to content

Commit

Permalink
fix(linter): race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Nov 20, 2024
1 parent 6f2a830 commit 44478f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.18.11
## 2.18.12

*2024-11-20*

Expand Down
2 changes: 1 addition & 1 deletion dist/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ declare global {
Linter: new () => Linter;
};
const stylelint: PublicApi;
const luacheck: {queue(s: string): Promise<LuaReport[]>};
const luacheck: Promise<{queue(s: string): Promise<LuaReport[]>}>;
const Parser: Parser;
}
4 changes: 2 additions & 2 deletions src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export const getCssLinter: getAsyncLinter<(text: string) => Promise<Warning[]>>

/** 获取 Luacheck */
export const getLuaLinter: getAsyncLinter<(text: string) => Promise<LuaReport[]>> = async () => {
await loadScript('gh/bhsd-harry/luacheck@0.0.2/dist/index.min.js', 'luacheck');
return text => luacheck.queue(text);
await loadScript('gh/bhsd-harry/luacheck@0.0.3/dist/index.min.js', 'luacheck');
return async text => (await luacheck).queue(text);
};

declare interface JsonError {
Expand Down

0 comments on commit 44478f7

Please sign in to comment.