Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

patch-missing-export-equals.js

20 lines540 Bytes

1// @ts-check
2​
3// https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
4​
5import fs from 'node:fs/promises'
6import path from 'node:path'
7​
8const projectDir = new URL('..', import.meta.url).pathname
9​
10const dtsFiles = [
11 path.join(projectDir, 'dist/index.d.ts'),
12 path.join(projectDir, 'dist/index.d.cts'),
14​
15for (const file of dtsFiles) {
16 await fs.appendFile(file, '\n\nexport = plugin')
17 console.log(
18 `Appended \`export = plugin\` to ${path.relative(projectDir, file)}`,
19 )