Skip to content

Commit 0f873d1

Browse files
committed
chore: update typegen script
1 parent cecdef3 commit 0f873d1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
"node": ">=18.18.0"
3737
},
3838
"scripts": {
39-
"build": "nr typegen && tsup",
39+
"build": "nr build:typegen && tsup",
4040
"dev": "tsup --format esm,cjs --watch & npx @eslint/config-inspector",
4141
"lint": "eslint .",
4242
"lint:fix": "eslint . --fix",
4343
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
44-
"typegen": "tsx scripts/typegen.ts",
44+
"build:typegen": "tsx scripts/typegen.ts",
4545
"prepack": "nr build",
4646
"prepare": "simple-git-hooks",
4747
"release": "bumpp && pnpm publish",

scripts/typegen.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import fs from 'node:fs/promises'
1+
import { writeFile } from 'node:fs/promises'
22
import { flatConfigsToRulesDTS } from 'eslint-typegen/core'
33
import { builtinRules } from 'eslint/use-at-your-own-risk'
4+
import picocolors from 'picocolors'
45
import {
56
command,
67
comments,
@@ -69,4 +70,6 @@ dts += `
6970
export type ConfigNames = ${configNames.map(i => `'${i}'`).join(' | ')}
7071
`
7172

72-
await fs.writeFile('src/types/typegen.d.ts', dts)
73+
await writeFile('src/types/typegen.d.ts', dts)
74+
75+
console.log(picocolors.green('Type definitions generated!'))

0 commit comments

Comments
 (0)