Skip to content

Commit 551b8bc

Browse files
committed
feat: add TypeScript declaration file
1 parent 8a1fddd commit 551b8bc

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

index.d.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
type PluginData = {
2+
importer: string
3+
content: string
4+
}
5+
type AdditionalConfigItem = {
6+
devDependencies?: Record<string, string>
7+
beforeVuePlugin?: PluginData[]
8+
afterVuePlugin?: PluginData[]
9+
}
10+
11+
export default function createConfig(options: {
12+
styleGuide?: 'default'
13+
hasTypeScript?: boolean
14+
needsPrettier?: boolean
15+
needsOxlint?: boolean
16+
additionalConfigs?: AdditionalConfigItem[]
17+
}): {
18+
pkg: {
19+
scripts: Record<string, string>
20+
devDependencies: Record<string, string>
21+
}
22+
files: {
23+
'eslint.config.js': string
24+
'.editorconfig': string
25+
'.prettierrc.json'?: string
26+
}
27+
}
28+
29+
/**
30+
* Recursively merge the content of the new object to the existing one
31+
* @param {object} target the existing object
32+
* @param {object} obj the new object
33+
*/
34+
export function deepMerge(target: object, obj: object): object

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ const mergeArrayWithDedupe = (a, b) => Array.from(new Set([...a, ...b]))
153153

154154
/**
155155
* Recursively merge the content of the new object to the existing one
156-
* @param {Object} target the existing object
157-
* @param {Object} obj the new object
156+
* @param {object} target the existing object
157+
* @param {object} obj the new object
158158
*/
159159
export function deepMerge(target, obj) {
160160
for (const key of Object.keys(obj)) {

0 commit comments

Comments
 (0)