@vida0905/eslint-config 0.1.2 → 0.1.4

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/index.cjs CHANGED
@@ -34,16 +34,18 @@ __export(src_exports, {
34
34
  vida: () => vida
35
35
  });
36
36
  module.exports = __toCommonJS(src_exports);
37
- var import_eslint_config3 = __toESM(require("@antfu/eslint-config"), 1);
37
+ var import_eslint_config2 = __toESM(require("@antfu/eslint-config"), 1);
38
38
  var import_local_pkg = require("local-pkg");
39
39
 
40
40
  // src/configs/pinia.ts
41
41
  var import_eslint_config = require("@antfu/eslint-config");
42
42
  var import_eslint_plugin_pinia = __toESM(require("eslint-plugin-pinia"), 1);
43
+ var GLOB_PINIA_JS = `stores/${import_eslint_config.GLOB_JS}`;
44
+ var GLOB_PINIA_TS = `stores/${import_eslint_config.GLOB_TS}`;
43
45
  var pinia = [
44
46
  {
45
- name: "vida:pinia",
46
- files: [import_eslint_config.GLOB_JS, import_eslint_config.GLOB_TS],
47
+ name: "vida/pinia",
48
+ files: [GLOB_PINIA_JS, GLOB_PINIA_TS],
47
49
  plugins: {
48
50
  pinia: import_eslint_plugin_pinia.default
49
51
  },
@@ -53,42 +55,26 @@ var pinia = [
53
55
  checkStoreNameMismatch: true,
54
56
  storeSuffix: "Store"
55
57
  }],
56
- "pinia/require-setup-store-properties-export": ["warn"]
58
+ "pinia/require-setup-store-properties-export": ["warn"],
59
+ "pinia/no-duplicate-store-ids": ["error"]
57
60
  }
58
61
  }
59
62
  ];
60
63
 
61
- // src/configs/vue.ts
62
- var import_eslint_config2 = require("@antfu/eslint-config");
63
- var vue = [
64
- {
65
- name: "vida:vue",
66
- files: [import_eslint_config2.GLOB_VUE],
67
- rules: {
68
- "vue/max-attributes-per-line": ["error", {
69
- singleline: { max: 5 },
70
- multiline: { max: 1 }
71
- }]
72
- }
73
- }
74
- ];
64
+ // src/overrides/vue.ts
65
+ var vue = {
66
+ "vue/max-attributes-per-line": ["error", {
67
+ singleline: 5,
68
+ multiline: 1
69
+ }]
70
+ };
75
71
 
76
72
  // src/index.ts
77
- var VuePackages = [
78
- "vue",
79
- "nuxt",
80
- "vitepress",
81
- "@slidev/cli"
82
- ];
83
73
  function vida(options = {}, ...userConfigs) {
84
74
  const {
85
- pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia"),
86
- // https://github.com/antfu/eslint-config/blob/main/src/factory.ts
87
- vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i))
75
+ pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia")
88
76
  } = options;
89
77
  const configs = [];
90
- if (enableVue)
91
- configs.push(vue);
92
78
  if (enablePinia)
93
79
  configs.push(pinia);
94
80
  const antfuConfig = {
@@ -101,9 +87,12 @@ function vida(options = {}, ...userConfigs) {
101
87
  css: true,
102
88
  html: true
103
89
  },
90
+ vue: {
91
+ overrides: vue
92
+ },
104
93
  jsx: false
105
94
  };
106
- return (0, import_eslint_config3.default)(
95
+ return (0, import_eslint_config2.default)(
107
96
  {
108
97
  ...antfuConfig,
109
98
  ...options
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
2
+ import * as _antfu_eslint_config from '@antfu/eslint-config';
2
3
  import { antfu, TypedFlatConfigItem } from '@antfu/eslint-config';
3
4
 
4
5
  type AntfuOptions = Parameters<typeof antfu>[0];
@@ -11,6 +12,6 @@ type OptionsConfig = AntfuOptions & {
11
12
  pinia?: boolean;
12
13
  };
13
14
 
14
- declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, string>;
15
+ declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config.ConfigNames>;
15
16
 
16
17
  export { vida as default, vida };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
2
+ import * as _antfu_eslint_config from '@antfu/eslint-config';
2
3
  import { antfu, TypedFlatConfigItem } from '@antfu/eslint-config';
3
4
 
4
5
  type AntfuOptions = Parameters<typeof antfu>[0];
@@ -11,6 +12,6 @@ type OptionsConfig = AntfuOptions & {
11
12
  pinia?: boolean;
12
13
  };
13
14
 
14
- declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, string>;
15
+ declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config.ConfigNames>;
15
16
 
16
17
  export { vida as default, vida };
package/dist/index.js CHANGED
@@ -5,10 +5,12 @@ import { isPackageExists } from "local-pkg";
5
5
  // src/configs/pinia.ts
6
6
  import { GLOB_JS, GLOB_TS } from "@antfu/eslint-config";
7
7
  import pluginPinia from "eslint-plugin-pinia";
8
+ var GLOB_PINIA_JS = `stores/${GLOB_JS}`;
9
+ var GLOB_PINIA_TS = `stores/${GLOB_TS}`;
8
10
  var pinia = [
9
11
  {
10
- name: "vida:pinia",
11
- files: [GLOB_JS, GLOB_TS],
12
+ name: "vida/pinia",
13
+ files: [GLOB_PINIA_JS, GLOB_PINIA_TS],
12
14
  plugins: {
13
15
  pinia: pluginPinia
14
16
  },
@@ -18,42 +20,26 @@ var pinia = [
18
20
  checkStoreNameMismatch: true,
19
21
  storeSuffix: "Store"
20
22
  }],
21
- "pinia/require-setup-store-properties-export": ["warn"]
23
+ "pinia/require-setup-store-properties-export": ["warn"],
24
+ "pinia/no-duplicate-store-ids": ["error"]
22
25
  }
23
26
  }
24
27
  ];
25
28
 
26
- // src/configs/vue.ts
27
- import { GLOB_VUE } from "@antfu/eslint-config";
28
- var vue = [
29
- {
30
- name: "vida:vue",
31
- files: [GLOB_VUE],
32
- rules: {
33
- "vue/max-attributes-per-line": ["error", {
34
- singleline: { max: 5 },
35
- multiline: { max: 1 }
36
- }]
37
- }
38
- }
39
- ];
29
+ // src/overrides/vue.ts
30
+ var vue = {
31
+ "vue/max-attributes-per-line": ["error", {
32
+ singleline: 5,
33
+ multiline: 1
34
+ }]
35
+ };
40
36
 
41
37
  // src/index.ts
42
- var VuePackages = [
43
- "vue",
44
- "nuxt",
45
- "vitepress",
46
- "@slidev/cli"
47
- ];
48
38
  function vida(options = {}, ...userConfigs) {
49
39
  const {
50
- pinia: enablePinia = isPackageExists("pinia"),
51
- // https://github.com/antfu/eslint-config/blob/main/src/factory.ts
52
- vue: enableVue = VuePackages.some((i) => isPackageExists(i))
40
+ pinia: enablePinia = isPackageExists("pinia")
53
41
  } = options;
54
42
  const configs = [];
55
- if (enableVue)
56
- configs.push(vue);
57
43
  if (enablePinia)
58
44
  configs.push(pinia);
59
45
  const antfuConfig = {
@@ -66,6 +52,9 @@ function vida(options = {}, ...userConfigs) {
66
52
  css: true,
67
53
  html: true
68
54
  },
55
+ vue: {
56
+ overrides: vue
57
+ },
69
58
  jsx: false
70
59
  };
71
60
  return antfu(
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@vida0905/eslint-config",
3
3
  "type": "module",
4
- "version": "0.1.2",
5
- "packageManager": "pnpm@8.15.6",
4
+ "version": "0.1.4",
6
5
  "description": "Vida Xie's ESLint Config",
7
6
  "author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
8
7
  "license": "MIT",
@@ -28,31 +27,30 @@
28
27
  "files": [
29
28
  "dist"
30
29
  ],
31
- "scripts": {
32
- "lint": "eslint .",
33
- "lint:fix": "eslint . --fix",
34
- "dev": "npx @eslint/config-inspector",
35
- "build": "tsup",
36
- "release": "bumpp && pnpm publish",
37
- "typecheck": "tsc --noEmit",
38
- "prepublish": "npm run build"
39
- },
40
30
  "peerDependencies": {
41
- "eslint": ">=8.0.0"
31
+ "eslint": ">=8.40.0"
42
32
  },
43
33
  "dependencies": {
44
- "@antfu/eslint-config": "^2.12.1",
45
- "eslint-plugin-pinia": "^0.1.10",
34
+ "@antfu/eslint-config": "^2.15.0",
35
+ "eslint-plugin-pinia": "^0.1.13",
46
36
  "local-pkg": "^0.5.0"
47
37
  },
48
38
  "devDependencies": {
49
- "@eslint/config-inspector": "^0.3.1",
50
- "@unocss/eslint-plugin": "0.59.0-beta.1",
39
+ "@eslint/config-inspector": "^0.4.6",
40
+ "@unocss/eslint-plugin": "0.59.4",
51
41
  "bumpp": "^9.4.0",
52
- "eslint": "npm:eslint-ts-patch@8.57.0-0",
53
- "eslint-plugin-format": "^0.1.0",
54
- "eslint-ts-patch": "8.57.0-0",
42
+ "eslint": "^9.0.0",
43
+ "eslint-plugin-format": "^0.1.1",
55
44
  "tsup": "^8.0.2",
56
- "typescript": "^5.4.4"
45
+ "typescript": "^5.4.5"
46
+ },
47
+ "scripts": {
48
+ "lint": "eslint .",
49
+ "lint:fix": "eslint . --fix",
50
+ "dev": "npx @eslint/config-inspector",
51
+ "build": "tsup",
52
+ "release": "bumpp && pnpm publish",
53
+ "typecheck": "tsc --noEmit",
54
+ "prepublish": "npm run build"
57
55
  }
58
- }
56
+ }