@vida0905/eslint-config 2.2.0 → 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 CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  import { green } from "ansis";
7
7
 
8
8
  //#region package.json
9
- var version = "2.2.0";
9
+ var version = "2.3.0";
10
10
 
11
11
  //#endregion
12
12
  //#region src/cli/constants.ts
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
- // ----- pinia/prefer-use-store-naming-convention -----
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, { GLOB_JS, GLOB_SRC, GLOB_TS, interopDefault, resolveSubOptions } from "@antfu/eslint-config";
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).prepend({
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.2.0",
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/)",
@@ -40,14 +40,11 @@
40
40
  "eslint": ">=9.10.0"
41
41
  },
42
42
  "dependencies": {
43
- "@antfu/eslint-config": "^4.13.3",
43
+ "@antfu/eslint-config": "^4.14.1",
44
44
  "ansis": "^4.1.0",
45
45
  "cac": "^6.7.14",
46
46
  "eslint-flat-config-utils": "^2.1.0",
47
- "eslint-import-resolver-oxc": "^0.15.0",
48
- "eslint-plugin-de-morgan": "^1.2.1",
49
- "eslint-plugin-pinia": "^0.4.1",
50
- "local-pkg": "^1.1.1"
47
+ "eslint-plugin-de-morgan": "^1.2.1"
51
48
  },
52
49
  "devDependencies": {
53
50
  "@types/node": "^22.15.30",
@@ -59,15 +56,6 @@
59
56
  "tsx": "^4.19.4",
60
57
  "typescript": "^5.8.3"
61
58
  },
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
- }
70
- },
71
59
  "simple-git-hooks": {
72
60
  "pre-commit": "npx nano-staged"
73
61
  },