@vida0905/eslint-config 2.1.2 → 2.2.0
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/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +1 -1
- package/dist/index.d.ts +81 -73
- package/package.json +25 -18
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
export { };
|
package/dist/cli/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,84 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
|
|
2
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
+
import { Linter } from "eslint";
|
|
4
|
+
export * from "@antfu/eslint-config";
|
|
5
5
|
|
|
6
|
+
//#region src/typegen.d.ts
|
|
6
7
|
interface RuleOptions {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan’s law
|
|
10
|
+
* @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-conjunction.md
|
|
11
|
+
*/
|
|
12
|
+
'de-morgan/no-negated-conjunction'?: Linter.RuleEntry<[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan’s law
|
|
15
|
+
* @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-disjunction.md
|
|
16
|
+
*/
|
|
17
|
+
'de-morgan/no-negated-disjunction'?: Linter.RuleEntry<[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Never export an initialized named or default store.
|
|
20
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/never-export-initialized-store.md
|
|
21
|
+
*/
|
|
22
|
+
'pinia/never-export-initialized-store'?: Linter.RuleEntry<[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Disallow duplicate store ids.
|
|
25
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-duplicate-store-ids.md
|
|
26
|
+
*/
|
|
27
|
+
'pinia/no-duplicate-store-ids'?: Linter.RuleEntry<[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Disallows returning globally provided properties from Pinia stores.
|
|
30
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-return-global-properties.md
|
|
31
|
+
*/
|
|
32
|
+
'pinia/no-return-global-properties'?: Linter.RuleEntry<[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Disallow use of storeToRefs inside defineStore
|
|
35
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-store-to-refs-in-store.md
|
|
36
|
+
*/
|
|
37
|
+
'pinia/no-store-to-refs-in-store'?: Linter.RuleEntry<[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Encourages defining each store in a separate file.
|
|
40
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-single-store-per-file.md
|
|
41
|
+
*/
|
|
42
|
+
'pinia/prefer-single-store-per-file'?: Linter.RuleEntry<[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Enforces the convention of naming stores with the prefix `use` followed by the store name.
|
|
45
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-use-store-naming-convention.md
|
|
46
|
+
*/
|
|
47
|
+
'pinia/prefer-use-store-naming-convention'?: Linter.RuleEntry<PiniaPreferUseStoreNamingConvention>;
|
|
48
|
+
/**
|
|
49
|
+
* In setup stores all state properties must be exported.
|
|
50
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/require-setup-store-properties-export.md
|
|
51
|
+
*/
|
|
52
|
+
'pinia/require-setup-store-properties-export'?: Linter.RuleEntry<[]>;
|
|
52
53
|
}
|
|
54
|
+
|
|
55
|
+
/* ======= Declarations ======= */
|
|
56
|
+
// ----- pinia/prefer-use-store-naming-convention -----
|
|
53
57
|
type PiniaPreferUseStoreNamingConvention = [] | [{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
checkStoreNameMismatch?: boolean;
|
|
59
|
+
storeSuffix?: string;
|
|
60
|
+
[k: string]: unknown | undefined;
|
|
57
61
|
}];
|
|
58
|
-
|
|
62
|
+
// Names of all the configs
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/types.d.ts
|
|
59
65
|
type Rules = RuleOptions;
|
|
60
|
-
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
type TypedFlatConfigItem$1 = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
67
|
+
/**
|
|
68
|
+
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
69
|
+
*
|
|
70
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
71
|
+
*/
|
|
72
|
+
plugins?: Record<string, any>;
|
|
67
73
|
};
|
|
68
74
|
interface OptionsOverrides {
|
|
69
|
-
|
|
75
|
+
overrides?: TypedFlatConfigItem$1["rules"];
|
|
70
76
|
}
|
|
71
|
-
type OptionsConfig = Omit<OptionsConfig
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
type OptionsConfig$1 = Omit<OptionsConfig, "overrides"> & {
|
|
78
|
+
/**
|
|
79
|
+
* Enable Pinia support.
|
|
80
|
+
*
|
|
81
|
+
* @default auto-detect based on the dependencies
|
|
82
|
+
*/
|
|
83
|
+
pinia?: boolean | OptionsOverrides;
|
|
78
84
|
};
|
|
79
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/utils.d.ts
|
|
80
87
|
declare function deepMerge<T extends object>(target: T, source: T): T;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/index.d.ts
|
|
90
|
+
declare function defineConfig(options?: OptionsConfig$1 & TypedFlatConfigItem, ...userConfigs: TypedFlatConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { deepMerge, defineConfig as default, defineConfig };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vida0905/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "2.2.0",
|
|
5
|
+
"packageManager": "pnpm@10.11.1",
|
|
6
6
|
"description": "Vida Xie's ESLint Config",
|
|
7
7
|
"author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -34,32 +34,39 @@
|
|
|
34
34
|
"typecheck": "tsc --noEmit",
|
|
35
35
|
"lint": "eslint .",
|
|
36
36
|
"check": "npm run typecheck && npm run lint",
|
|
37
|
-
"
|
|
38
|
-
"prepare": "npm run typegen && simple-git-hooks"
|
|
37
|
+
"prepare": "npm run typegen && npm run build"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
40
|
"eslint": ">=9.10.0"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@antfu/eslint-config": "^4.3
|
|
45
|
-
"ansis": "^
|
|
43
|
+
"@antfu/eslint-config": "^4.13.3",
|
|
44
|
+
"ansis": "^4.1.0",
|
|
46
45
|
"cac": "^6.7.14",
|
|
47
|
-
"eslint-flat-config-utils": "^2.0
|
|
48
|
-
"eslint-import-resolver-oxc": "^0.
|
|
49
|
-
"eslint-plugin-de-morgan": "^1.1
|
|
46
|
+
"eslint-flat-config-utils": "^2.1.0",
|
|
47
|
+
"eslint-import-resolver-oxc": "^0.15.0",
|
|
48
|
+
"eslint-plugin-de-morgan": "^1.2.1",
|
|
50
49
|
"eslint-plugin-pinia": "^0.4.1",
|
|
51
|
-
"local-pkg": "^1.
|
|
50
|
+
"local-pkg": "^1.1.1"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@types/node": "^22.
|
|
55
|
-
"eslint": "^9.
|
|
56
|
-
"eslint-typegen": "^2.
|
|
53
|
+
"@types/node": "^22.15.30",
|
|
54
|
+
"eslint": "^9.28.0",
|
|
55
|
+
"eslint-typegen": "^2.2.0",
|
|
57
56
|
"nano-staged": "^0.8.0",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
57
|
+
"simple-git-hooks": "^2.13.0",
|
|
58
|
+
"tsdown": "^0.12.7",
|
|
59
|
+
"tsx": "^4.19.4",
|
|
60
|
+
"typescript": "^5.8.3"
|
|
61
|
+
},
|
|
62
|
+
"pnpm": {
|
|
63
|
+
"overrides": {
|
|
64
|
+
"eslint-import-resolver-node": "-",
|
|
65
|
+
"unrs-resolver": "-"
|
|
66
|
+
},
|
|
67
|
+
"patchedDependencies": {
|
|
68
|
+
"eslint-plugin-import-x": "patches/eslint-plugin-import-x.patch"
|
|
69
|
+
}
|
|
63
70
|
},
|
|
64
71
|
"simple-git-hooks": {
|
|
65
72
|
"pre-commit": "npx nano-staged"
|