@vida0905/eslint-config 2.2.1 → 2.3.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.js +1 -1
- package/dist/index.d.ts +1 -41
- package/dist/index.js +2 -35
- package/package.json +4 -17
package/dist/cli/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -15,50 +15,10 @@ interface RuleOptions {
|
|
|
15
15
|
* @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-disjunction.md
|
|
16
16
|
*/
|
|
17
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<[]>;
|
|
53
18
|
}
|
|
54
19
|
|
|
55
20
|
/* ======= Declarations ======= */
|
|
56
|
-
|
|
57
|
-
type PiniaPreferUseStoreNamingConvention = [] | [{
|
|
58
|
-
checkStoreNameMismatch?: boolean;
|
|
59
|
-
storeSuffix?: string;
|
|
60
|
-
[k: string]: unknown | undefined;
|
|
61
|
-
}];
|
|
21
|
+
|
|
62
22
|
// Names of all the configs
|
|
63
23
|
//#endregion
|
|
64
24
|
//#region src/types.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import antfu, {
|
|
2
|
-
import { createOxcImportResolver } from "eslint-import-resolver-oxc";
|
|
3
|
-
import { isPackageExists } from "local-pkg";
|
|
1
|
+
import antfu, { GLOB_SRC } from "@antfu/eslint-config";
|
|
4
2
|
import _deMorgan from "eslint-plugin-de-morgan";
|
|
5
3
|
|
|
6
4
|
export * from "@antfu/eslint-config"
|
|
@@ -15,32 +13,6 @@ function deMorgan(options = {}) {
|
|
|
15
13
|
}];
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/configs/pinia.ts
|
|
20
|
-
const GLOB_PINIA_JS = `**/stores/${GLOB_JS}`;
|
|
21
|
-
const GLOB_PINIA_TS = `**/stores/${GLOB_TS}`;
|
|
22
|
-
async function pinia(options = {}) {
|
|
23
|
-
const { files = [GLOB_PINIA_JS, GLOB_PINIA_TS], overrides: overrides$1 = {} } = options;
|
|
24
|
-
return [{
|
|
25
|
-
name: "vida/pinia/rules",
|
|
26
|
-
files,
|
|
27
|
-
plugins: { pinia: await interopDefault(import("eslint-plugin-pinia")) },
|
|
28
|
-
rules: {
|
|
29
|
-
"pinia/never-export-initialized-store": "error",
|
|
30
|
-
"pinia/prefer-single-store-per-file": "warn",
|
|
31
|
-
"pinia/prefer-use-store-naming-convention": ["error", {
|
|
32
|
-
checkStoreNameMismatch: true,
|
|
33
|
-
storeSuffix: "Store"
|
|
34
|
-
}],
|
|
35
|
-
"pinia/require-setup-store-properties-export": "warn",
|
|
36
|
-
"pinia/no-duplicate-store-ids": "error",
|
|
37
|
-
"pinia/no-return-global-properties": "error",
|
|
38
|
-
"pinia/no-store-to-refs-in-store": "error",
|
|
39
|
-
...overrides$1
|
|
40
|
-
}
|
|
41
|
-
}];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
16
|
//#endregion
|
|
45
17
|
//#region src/overrides/javascript.ts
|
|
46
18
|
const javascript = {
|
|
@@ -86,9 +58,7 @@ function deepMerge(target, source) {
|
|
|
86
58
|
//#endregion
|
|
87
59
|
//#region src/index.ts
|
|
88
60
|
function defineConfig(options = {}, ...userConfigs) {
|
|
89
|
-
const { pinia: enablePinia = isPackageExists("pinia") } = options;
|
|
90
61
|
const configs = [deMorgan()];
|
|
91
|
-
if (enablePinia) configs.push(pinia(resolveSubOptions(options, "pinia")));
|
|
92
62
|
const antfuConfig = {
|
|
93
63
|
stylistic: {
|
|
94
64
|
indent: 2,
|
|
@@ -99,10 +69,7 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
99
69
|
javascript: { overrides: overrides.javascript },
|
|
100
70
|
vue: { overrides: overrides.vue }
|
|
101
71
|
};
|
|
102
|
-
return antfu(deepMerge(antfuConfig, options), ...configs, ...userConfigs)
|
|
103
|
-
name: "vida/imports/setup",
|
|
104
|
-
settings: { "import-x/resolver-next": [createOxcImportResolver()] }
|
|
105
|
-
});
|
|
72
|
+
return antfu(deepMerge(antfuConfig, options), ...configs, ...userConfigs);
|
|
106
73
|
}
|
|
107
74
|
var src_default = defineConfig;
|
|
108
75
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vida0905/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
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/)",
|
|
@@ -37,18 +37,14 @@
|
|
|
37
37
|
"prepare": "npm run typegen && npm run build"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"eslint": ">=9.10.0"
|
|
41
|
-
"oxc-resolver": "*"
|
|
40
|
+
"eslint": ">=9.10.0"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@antfu/eslint-config": "^4.
|
|
43
|
+
"@antfu/eslint-config": "^4.14.1",
|
|
45
44
|
"ansis": "^4.1.0",
|
|
46
45
|
"cac": "^6.7.14",
|
|
47
46
|
"eslint-flat-config-utils": "^2.1.0",
|
|
48
|
-
"eslint-
|
|
49
|
-
"eslint-plugin-de-morgan": "^1.2.1",
|
|
50
|
-
"eslint-plugin-pinia": "^0.4.1",
|
|
51
|
-
"local-pkg": "^1.1.1"
|
|
47
|
+
"eslint-plugin-de-morgan": "^1.2.1"
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
54
50
|
"@types/node": "^22.15.30",
|
|
@@ -60,15 +56,6 @@
|
|
|
60
56
|
"tsx": "^4.19.4",
|
|
61
57
|
"typescript": "^5.8.3"
|
|
62
58
|
},
|
|
63
|
-
"pnpm": {
|
|
64
|
-
"overrides": {
|
|
65
|
-
"eslint-import-resolver-node": "-",
|
|
66
|
-
"unrs-resolver": "-"
|
|
67
|
-
},
|
|
68
|
-
"patchedDependencies": {
|
|
69
|
-
"eslint-plugin-import-x": "patches/eslint-plugin-import-x.patch"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
59
|
"simple-git-hooks": {
|
|
73
60
|
"pre-commit": "npx nano-staged"
|
|
74
61
|
},
|