@mouse_484/eslint-config 5.3.6 → 5.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mouse_484/eslint-config",
3
3
  "type": "module",
4
- "version": "5.3.6",
4
+ "version": "5.3.8",
5
5
  "author": "mouse_484",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
@@ -16,13 +16,13 @@
16
16
  "eslint-config"
17
17
  ],
18
18
  "main": "src/index.js",
19
- "types": "src/lib/type.d.ts",
19
+ "types": "src/index.d.ts",
20
20
  "bin": "bin/cli.js",
21
21
  "scripts": {
22
22
  "typegen": "node scripts/typegen.js"
23
23
  },
24
24
  "dependencies": {
25
- "@antfu/eslint-config": "^6.0.0",
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
  },
package/src/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type antfu from '@antfu/eslint-config'
2
+
3
+ type AntfuParameters = Parameters<typeof antfu>
4
+ type AntfuOptions = AntfuParameters['0']
5
+ type AntfuUserConfigs = AntfuParameters['1'][]
6
+
7
+ export type Options = AntfuOptions & {
8
+ tailwind?: boolean | { entryPoint?: string }
9
+ }
10
+
11
+ export declare function mouse(
12
+ options?: Options,
13
+ ...configs: AntfuUserConfigs
14
+ ): ReturnType<typeof antfu>
15
+ export default mouse
package/src/index.js CHANGED
@@ -7,7 +7,7 @@ import svelte from './configs/svelte.js'
7
7
  import tailwind from './configs/tailwind.js'
8
8
  import unicorn from './configs/unicorn.js'
9
9
 
10
- /** @type {import('./lib/type.js').mouse} */
10
+ /** @type {import('.').mouse} */
11
11
  async function mouse(options, ...userConfigs) {
12
12
  options = {
13
13
  unicorn: {
@@ -0,0 +1,16 @@
1
+ import type { Rules, TypedFlatConfigItem } from '@antfu/eslint-config'
2
+ import type { Options } from '..'
3
+ import type { RuleOptions } from './rules.gen'
4
+
5
+ interface ConfigItem extends TypedFlatConfigItem {
6
+ withOptions?: (keyof Options)[]
7
+ name: string
8
+ rules?: Rules & RuleOptions
9
+ }
10
+
11
+ type OnlyObject<T> = T extends object ? T : never
12
+ export declare function createConfigs<T extends keyof Options = undefined>(parameters: {
13
+ name: string
14
+ baseWithOption?: T
15
+ configs: (ConfigItem | ((meta?: OnlyObject<Options[T]>) => ConfigItem))[]
16
+ }): (options: Options) => TypedFlatConfigItem[]
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  *
3
3
  * @param {string} name
4
- * @param {(keyof import('./type').Options)[]} withOptions
4
+ * @param {(keyof import('..').Options)[]} withOptions
5
5
  * @param {Omit<import('@antfu/eslint-config').TypedFlatConfigItem,'name'>} config
6
- * @returns {(options: import('./type').Options) => import('@antfu/eslint-config').TypedFlatConfigItem|[]} _
6
+ * @returns {(options: import('..').Options) => import('@antfu/eslint-config').TypedFlatConfigItem|[]} _
7
7
  */
8
8
  function createConfig(name, withOptions, config) {
9
9
  return (options) => {
@@ -20,7 +20,7 @@ function createConfig(name, withOptions, config) {
20
20
  }
21
21
  }
22
22
 
23
- /** @type {import('./type').createConfigs} */
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 DELETED
@@ -1,27 +0,0 @@
1
- /// <reference types="./rules.gen.d.ts" />
2
-
3
- import type antfu from '@antfu/eslint-config'
4
- import type { TypedFlatConfigItem } from '@antfu/eslint-config'
5
-
6
- type AntfuParameters = Parameters<typeof antfu>
7
- type AntfuOptions = AntfuParameters['0']
8
- type AntfuUserConfigs = AntfuParameters['1'][]
9
-
10
- export type Options = AntfuOptions & {
11
- tailwind?: boolean | { entryPoint?: string }
12
- }
13
-
14
- export declare function mouse(
15
- options?: Options,
16
- ...configs: AntfuUserConfigs
17
- ): ReturnType<typeof antfu>
18
- 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[]