Skip to content

Commit

Permalink
fix: fix es module interop
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Dec 28, 2021
1 parent ab398aa commit be4d269
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/core-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ export class SerializableCore {
return this.core.makeFixableAndFix(results, ruleIds, fixableMaker);
}
}

expose(SerializableCore, nodeEndpoint(parentPort));
expose(SerializableCore, nodeEndpoint.default(parentPort));
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function run(options: Options) {
// Directly executing the Core API will hog the main thread and halt the spinner.
// So we wrap it with comlink and run it on the Worker.
const worker = new Worker(join(__dirname, 'core-worker.js'));
const ProxiedCore = wrap<typeof SerializableCore>(nodeEndpoint(worker));
const ProxiedCore = wrap<typeof SerializableCore>(nodeEndpoint.default(worker));
const core = await new ProxiedCore(config);

let nextScene: NextScene = { name: 'lint' };
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* Module Options */
"module": "node12",
"moduleResolution": "node12",
"esModuleInterop": true, // CommonJS モジュールを `import _ from 'commonjs'` で import できるように
"esModuleInterop": false, // `"module": "node12"` との相性が悪いので off にする
"resolveJsonModule": true, // import した json の型を推論するように
"forceConsistentCasingInFileNames": true, // 大文字小文字を区別しない環境 (win) でも unix と同じように区別する

Expand Down

0 comments on commit be4d269

Please sign in to comment.