Skip to content

Commit

Permalink
fix: errors caught by promise rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Nov 6, 2024
1 parent 6ca8dfb commit fb9e058
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ module.exports = {
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'promise/catch-or-return': 'off',
'promise/always-return': 'off',

// TODO(@lishaduck): Security issues that should eventually get fixed.
'security/detect-object-injection': 'off',
Expand Down
5 changes: 3 additions & 2 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,13 @@ async function buildElmParser(options, reviewElmJson) {
// Needed when the user has `"type": "module"` in their package.json.
// Our output is CommonJS.
// TODO(@lishaduck): Switch to a .cjs file instead.
FS.mkdirp(options.generatedCodePackageJson()).then(async () => {
async () => {
await FS.mkdirp(options.generatedCodePackageJson());
await FS.writeFile(
path.join(options.generatedCodePackageJson(), 'package.json'),
'{"type":"commonjs"}'
);
})
}
]);

await compileElmProject(
Expand Down
7 changes: 3 additions & 4 deletions lib/parse-elm-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ if (parentPort) {
* @returns {void}
*/
function subscribe(parentPort) {
parentPort.on('message', (queueItem) => {
workerParseElm(queueItem).then((result) => {
parentPort.postMessage(result);
});
parentPort.on('message', async (queueItem) => {
const result = await workerParseElm(queueItem);
parentPort.postMessage(result);
});
}

Expand Down

0 comments on commit fb9e058

Please sign in to comment.