@mouse_484/eslint-config 5.3.6 → 5.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/lib/factory.d.ts +10 -0
- package/src/lib/factory.js +1 -1
- package/src/lib/type.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mouse_484/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.3.
|
|
4
|
+
"version": "5.3.7",
|
|
5
5
|
"author": "mouse_484",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typegen": "node scripts/typegen.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@antfu/eslint-config": "^6.
|
|
25
|
+
"@antfu/eslint-config": "^6.1.0",
|
|
26
26
|
"eslint-plugin-better-tailwindcss": "^3.7.10",
|
|
27
27
|
"package-manager-detector": "^1.5.0"
|
|
28
28
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TypedFlatConfigItem } from '@antfu/eslint-config'
|
|
2
|
+
import type { Options } from './type'
|
|
3
|
+
|
|
4
|
+
type ConfigItem = TypedFlatConfigItem & { withOptions?: (keyof Options)[], name: string }
|
|
5
|
+
type OnlyObject<T> = T extends object ? T : never
|
|
6
|
+
export declare function createConfigs<T extends keyof Options = undefined>(parameters: {
|
|
7
|
+
name: string
|
|
8
|
+
baseWithOption?: T
|
|
9
|
+
configs: (ConfigItem | ((meta?: OnlyObject<Options[T]>) => ConfigItem))[]
|
|
10
|
+
}): (options: Options) => TypedFlatConfigItem[]
|
package/src/lib/factory.js
CHANGED
|
@@ -20,7 +20,7 @@ function createConfig(name, withOptions, config) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/** @type {import('./
|
|
23
|
+
/** @type {import('./factory').createConfigs} */
|
|
24
24
|
export function createConfigs({ name, baseWithOption, configs }) {
|
|
25
25
|
return (options) => {
|
|
26
26
|
return configs.flatMap((configItem) => {
|
package/src/lib/type.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="./rules.gen.d.ts" />
|
|
2
2
|
|
|
3
3
|
import type antfu from '@antfu/eslint-config'
|
|
4
|
-
import type { TypedFlatConfigItem } from '@antfu/eslint-config'
|
|
5
4
|
|
|
6
5
|
type AntfuParameters = Parameters<typeof antfu>
|
|
7
6
|
type AntfuOptions = AntfuParameters['0']
|
|
@@ -16,12 +15,3 @@ export declare function mouse(
|
|
|
16
15
|
...configs: AntfuUserConfigs
|
|
17
16
|
): ReturnType<typeof antfu>
|
|
18
17
|
export default mouse
|
|
19
|
-
|
|
20
|
-
// factory
|
|
21
|
-
type ConfigItem = TypedFlatConfigItem & { withOptions?: (keyof Options)[], name: string }
|
|
22
|
-
type OnlyObject<T> = T extends object ? T : never
|
|
23
|
-
export declare function createConfigs<T extends keyof Options = undefined>(parameters: {
|
|
24
|
-
name: string
|
|
25
|
-
baseWithOption?: T
|
|
26
|
-
configs: (ConfigItem | ((meta?: OnlyObject<Options[T]>) => ConfigItem))[]
|
|
27
|
-
}): (options: Options) => TypedFlatConfigItem[]
|