-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,715 additions
and
1,149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
node_modules | ||
*.log* | ||
src/types.gen.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import {defineBuildConfig } from 'unbuild' | ||
import fs from "node:fs/promises" | ||
import { defineBuildConfig } from "unbuild"; | ||
import fs from "node:fs/promises"; | ||
|
||
export default defineBuildConfig({ | ||
hooks: { | ||
async "build:before"() { | ||
const unjsPreset = await import('./src/eslint.config').then(m => m.default) | ||
const { flatConfigsToRulesDTS } = await import('eslint-typegen/core') | ||
const dts = await flatConfigsToRulesDTS(unjsPreset(), { | ||
includeAugmentation: false, | ||
}) | ||
await fs.writeFile('src/types.gen.d.ts', dts) | ||
} | ||
} | ||
}) | ||
hooks: { | ||
async "build:before"() { | ||
const unjsPreset = await import("./src/eslint.config").then( | ||
(m) => m.default, | ||
); | ||
const { flatConfigsToRulesDTS } = await import("eslint-typegen/core"); | ||
const dts = await flatConfigsToRulesDTS(unjsPreset(), { | ||
includeAugmentation: false, | ||
}); | ||
await fs.writeFile("src/types.gen.d.ts", dts); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import jiti from 'jiti' | ||
import jiti from "jiti"; | ||
|
||
/** @type import("./src/eslint.config") */ | ||
const unjs = jiti(import.meta.url)('./src/eslint.config.ts') | ||
const unjs = jiti(import.meta.url)("./src/eslint.config.ts"); | ||
|
||
export default unjs.default({ | ||
rules: {} | ||
}) | ||
export default unjs.default( | ||
{ ignores: ["**/types.gen.d.ts"] }, | ||
{ rules: {} } | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.