@culur/config-eslint 1.0.4 → 1.0.6

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.
Files changed (116) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/chunk-2VJ7YXJ5.cjs +22 -0
  3. package/dist/chunk-2VJ7YXJ5.cjs.map +1 -0
  4. package/dist/chunk-4BKKYD37.cjs +28 -0
  5. package/dist/chunk-4BKKYD37.cjs.map +1 -0
  6. package/dist/chunk-BV3HMMMY.js +3 -0
  7. package/dist/chunk-BV3HMMMY.js.map +1 -0
  8. package/dist/chunk-CXG4MLTZ.cjs +11 -0
  9. package/dist/chunk-CXG4MLTZ.cjs.map +1 -0
  10. package/dist/chunk-EKPTTXW4.js +20 -0
  11. package/dist/chunk-EKPTTXW4.js.map +1 -0
  12. package/dist/{chunk-ZIJ5OQW5.cjs → chunk-GMS5WKM7.cjs} +3 -3
  13. package/dist/chunk-GMS5WKM7.cjs.map +1 -0
  14. package/dist/chunk-GS27ENXD.cjs +4 -0
  15. package/dist/chunk-GS27ENXD.cjs.map +1 -0
  16. package/dist/chunk-HTFVO7PM.js +9 -0
  17. package/dist/chunk-HTFVO7PM.js.map +1 -0
  18. package/dist/chunk-HXCKETJH.js +38 -0
  19. package/dist/chunk-HXCKETJH.js.map +1 -0
  20. package/dist/chunk-KA55FMNP.cjs +4 -0
  21. package/dist/chunk-KA55FMNP.cjs.map +1 -0
  22. package/dist/chunk-KN3PLU2G.cjs +42 -0
  23. package/dist/chunk-KN3PLU2G.cjs.map +1 -0
  24. package/dist/chunk-LKISCATA.js +3 -0
  25. package/dist/chunk-LKISCATA.js.map +1 -0
  26. package/dist/chunk-QIHNKJHG.js +26 -0
  27. package/dist/chunk-QIHNKJHG.js.map +1 -0
  28. package/dist/{chunk-N7KES6RB.js → chunk-SM7NAKS7.js} +4 -4
  29. package/dist/chunk-SM7NAKS7.js.map +1 -0
  30. package/dist/index.cjs +19 -7
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +2 -2
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +19 -7
  35. package/dist/index.js.map +1 -1
  36. package/dist/overrides/index.cjs +18 -0
  37. package/dist/overrides/index.cjs.map +1 -0
  38. package/dist/overrides/index.d.cts +4 -0
  39. package/dist/overrides/index.d.ts +4 -0
  40. package/dist/overrides/index.js +5 -0
  41. package/dist/overrides/index.js.map +1 -0
  42. package/dist/overrides/sort-package-json.cjs +3 -3
  43. package/dist/overrides/sort-package-json.cjs.map +1 -1
  44. package/dist/overrides/sort-package-json.d.cts +1 -1
  45. package/dist/overrides/sort-package-json.d.ts +1 -1
  46. package/dist/overrides/sort-package-json.js +2 -2
  47. package/dist/overrides/sort-package-json.js.map +1 -1
  48. package/dist/overrides/vue-rules.cjs +12 -0
  49. package/dist/overrides/vue-rules.cjs.map +1 -0
  50. package/dist/overrides/vue-rules.d.cts +6 -0
  51. package/dist/overrides/vue-rules.d.ts +6 -0
  52. package/dist/overrides/vue-rules.js +3 -0
  53. package/dist/overrides/vue-rules.js.map +1 -0
  54. package/dist/rules/filename.cjs +12 -0
  55. package/dist/rules/filename.cjs.map +1 -0
  56. package/dist/rules/filename.d.cts +5 -0
  57. package/dist/rules/filename.d.ts +5 -0
  58. package/dist/rules/filename.js +3 -0
  59. package/dist/rules/filename.js.map +1 -0
  60. package/dist/rules/index.cjs +26 -0
  61. package/dist/rules/index.cjs.map +1 -0
  62. package/dist/rules/index.d.cts +3 -0
  63. package/dist/rules/index.d.ts +3 -0
  64. package/dist/rules/index.js +5 -0
  65. package/dist/rules/index.js.map +1 -0
  66. package/dist/rules/yarnrc-yml.cjs +20 -0
  67. package/dist/rules/yarnrc-yml.cjs.map +1 -0
  68. package/dist/rules/yarnrc-yml.d.cts +38 -0
  69. package/dist/rules/yarnrc-yml.d.ts +38 -0
  70. package/dist/rules/yarnrc-yml.js +3 -0
  71. package/dist/rules/yarnrc-yml.js.map +1 -0
  72. package/dist/types/index.cjs +12 -0
  73. package/dist/types/index.cjs.map +1 -0
  74. package/dist/types/index.d.cts +12 -0
  75. package/dist/types/index.d.ts +12 -0
  76. package/dist/types/index.js +3 -0
  77. package/dist/types/index.js.map +1 -0
  78. package/package.json +31 -16
  79. package/src/index.test.ts +17 -4
  80. package/src/index.ts +18 -6
  81. package/src/overrides/index.ts +2 -0
  82. package/src/overrides/sort-package-json.test.ts +13 -11
  83. package/src/overrides/sort-package-json.ts +2 -2
  84. package/src/overrides/vue-rules.test.ts +19 -0
  85. package/src/overrides/vue-rules.ts +17 -0
  86. package/src/rules/{unicorn-filename-case.test.ts → filename.test.ts} +2 -2
  87. package/src/rules/filename.ts +23 -0
  88. package/src/rules/index.ts +2 -0
  89. package/src/rules/yarnrc-yml.test.ts +7 -0
  90. package/src/rules/yarnrc-yml.ts +47 -0
  91. package/src/{overrides/types.test.ts → types/index.test.ts} +4 -4
  92. package/src/types/index.ts +14 -0
  93. package/dist/chunk-4NIL3QOR.cjs +0 -8
  94. package/dist/chunk-4NIL3QOR.cjs.map +0 -1
  95. package/dist/chunk-N7KES6RB.js.map +0 -1
  96. package/dist/chunk-QYDW5TS2.js +0 -17
  97. package/dist/chunk-QYDW5TS2.js.map +0 -1
  98. package/dist/chunk-TZB7IM2G.cjs +0 -19
  99. package/dist/chunk-TZB7IM2G.cjs.map +0 -1
  100. package/dist/chunk-WJDZNLOH.js +0 -6
  101. package/dist/chunk-WJDZNLOH.js.map +0 -1
  102. package/dist/chunk-ZIJ5OQW5.cjs.map +0 -1
  103. package/dist/overrides/types.cjs +0 -12
  104. package/dist/overrides/types.cjs.map +0 -1
  105. package/dist/overrides/types.d.cts +0 -9
  106. package/dist/overrides/types.d.ts +0 -9
  107. package/dist/overrides/types.js +0 -3
  108. package/dist/overrides/types.js.map +0 -1
  109. package/dist/rules/unicorn-filename-case.cjs +0 -12
  110. package/dist/rules/unicorn-filename-case.cjs.map +0 -1
  111. package/dist/rules/unicorn-filename-case.d.cts +0 -5
  112. package/dist/rules/unicorn-filename-case.d.ts +0 -5
  113. package/dist/rules/unicorn-filename-case.js +0 -3
  114. package/dist/rules/unicorn-filename-case.js.map +0 -1
  115. package/src/overrides/types.ts +0 -9
  116. package/src/rules/unicorn-filename-case.ts +0 -14
@@ -1,4 +1,4 @@
1
- import { OverrideConfig } from './types.cjs';
1
+ import { OverrideConfig } from '../types/index.cjs';
2
2
  import '@antfu/eslint-config';
3
3
 
4
4
  declare const sortPackageJson: OverrideConfig;
@@ -1,4 +1,4 @@
1
- import { OverrideConfig } from './types.js';
1
+ import { OverrideConfig } from '../types/index.js';
2
2
  import '@antfu/eslint-config';
3
3
 
4
4
  declare const sortPackageJson: OverrideConfig;
@@ -1,3 +1,3 @@
1
- export { sortPackageJson } from '../chunk-N7KES6RB.js';
2
- //# sourceMappingURL=out.js.map
1
+ export { sortPackageJson } from '../chunk-SM7NAKS7.js';
2
+ //# sourceMappingURL=sort-package-json.js.map
3
3
  //# sourceMappingURL=sort-package-json.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"sort-package-json.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunk2VJ7YXJ5_cjs = require('../chunk-2VJ7YXJ5.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "vueRules", {
8
+ enumerable: true,
9
+ get: function () { return chunk2VJ7YXJ5_cjs.vueRules; }
10
+ });
11
+ //# sourceMappingURL=vue-rules.cjs.map
12
+ //# sourceMappingURL=vue-rules.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"vue-rules.cjs"}
@@ -0,0 +1,6 @@
1
+ import { OverrideConfig } from '../types/index.cjs';
2
+ import '@antfu/eslint-config';
3
+
4
+ declare const vueRules: OverrideConfig;
5
+
6
+ export { vueRules };
@@ -0,0 +1,6 @@
1
+ import { OverrideConfig } from '../types/index.js';
2
+ import '@antfu/eslint-config';
3
+
4
+ declare const vueRules: OverrideConfig;
5
+
6
+ export { vueRules };
@@ -0,0 +1,3 @@
1
+ export { vueRules } from '../chunk-EKPTTXW4.js';
2
+ //# sourceMappingURL=vue-rules.js.map
3
+ //# sourceMappingURL=vue-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"vue-rules.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunk4BKKYD37_cjs = require('../chunk-4BKKYD37.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "filenameRules", {
8
+ enumerable: true,
9
+ get: function () { return chunk4BKKYD37_cjs.filenameRules; }
10
+ });
11
+ //# sourceMappingURL=filename.cjs.map
12
+ //# sourceMappingURL=filename.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"filename.cjs"}
@@ -0,0 +1,5 @@
1
+ import { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ declare const filenameRules: TypedFlatConfigItem;
4
+
5
+ export { filenameRules };
@@ -0,0 +1,5 @@
1
+ import { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ declare const filenameRules: TypedFlatConfigItem;
4
+
5
+ export { filenameRules };
@@ -0,0 +1,3 @@
1
+ export { filenameRules } from '../chunk-QIHNKJHG.js';
2
+ //# sourceMappingURL=filename.js.map
3
+ //# sourceMappingURL=filename.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"filename.js"}
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ require('../chunk-KA55FMNP.cjs');
4
+ var chunk4BKKYD37_cjs = require('../chunk-4BKKYD37.cjs');
5
+ var chunkKN3PLU2G_cjs = require('../chunk-KN3PLU2G.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "filenameRules", {
10
+ enumerable: true,
11
+ get: function () { return chunk4BKKYD37_cjs.filenameRules; }
12
+ });
13
+ Object.defineProperty(exports, "yamlOrder", {
14
+ enumerable: true,
15
+ get: function () { return chunkKN3PLU2G_cjs.yamlOrder; }
16
+ });
17
+ Object.defineProperty(exports, "yamlYarnrcRules", {
18
+ enumerable: true,
19
+ get: function () { return chunkKN3PLU2G_cjs.yamlYarnrcRules; }
20
+ });
21
+ Object.defineProperty(exports, "yamlYarnrcSortKeys", {
22
+ enumerable: true,
23
+ get: function () { return chunkKN3PLU2G_cjs.yamlYarnrcSortKeys; }
24
+ });
25
+ //# sourceMappingURL=index.cjs.map
26
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+ export { filenameRules } from './filename.cjs';
2
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys } from './yarnrc-yml.cjs';
3
+ import '@antfu/eslint-config';
@@ -0,0 +1,3 @@
1
+ export { filenameRules } from './filename.js';
2
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys } from './yarnrc-yml.js';
3
+ import '@antfu/eslint-config';
@@ -0,0 +1,5 @@
1
+ import '../chunk-BV3HMMMY.js';
2
+ export { filenameRules } from '../chunk-QIHNKJHG.js';
3
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys } from '../chunk-HXCKETJH.js';
4
+ //# sourceMappingURL=index.js.map
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var chunkKN3PLU2G_cjs = require('../chunk-KN3PLU2G.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "yamlOrder", {
8
+ enumerable: true,
9
+ get: function () { return chunkKN3PLU2G_cjs.yamlOrder; }
10
+ });
11
+ Object.defineProperty(exports, "yamlYarnrcRules", {
12
+ enumerable: true,
13
+ get: function () { return chunkKN3PLU2G_cjs.yamlYarnrcRules; }
14
+ });
15
+ Object.defineProperty(exports, "yamlYarnrcSortKeys", {
16
+ enumerable: true,
17
+ get: function () { return chunkKN3PLU2G_cjs.yamlYarnrcSortKeys; }
18
+ });
19
+ //# sourceMappingURL=yarnrc-yml.cjs.map
20
+ //# sourceMappingURL=yarnrc-yml.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"yarnrc-yml.cjs"}
@@ -0,0 +1,38 @@
1
+ import { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ declare const yamlOrder: {
4
+ readonly type: "asc";
5
+ readonly caseSensitive: false;
6
+ readonly natural: true;
7
+ };
8
+ declare const yamlYarnrcSortKeys: {
9
+ packageExtensions: {
10
+ packages: {
11
+ pathPattern: string;
12
+ order: {
13
+ readonly type: "asc";
14
+ readonly caseSensitive: false;
15
+ readonly natural: true;
16
+ };
17
+ };
18
+ dependenciesTypes: {
19
+ pathPattern: string;
20
+ order: {
21
+ readonly type: "asc";
22
+ readonly caseSensitive: false;
23
+ readonly natural: true;
24
+ };
25
+ };
26
+ childPackages: {
27
+ pathPattern: string;
28
+ order: {
29
+ readonly type: "asc";
30
+ readonly caseSensitive: false;
31
+ readonly natural: true;
32
+ };
33
+ };
34
+ };
35
+ };
36
+ declare const yamlYarnrcRules: TypedFlatConfigItem;
37
+
38
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys };
@@ -0,0 +1,38 @@
1
+ import { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ declare const yamlOrder: {
4
+ readonly type: "asc";
5
+ readonly caseSensitive: false;
6
+ readonly natural: true;
7
+ };
8
+ declare const yamlYarnrcSortKeys: {
9
+ packageExtensions: {
10
+ packages: {
11
+ pathPattern: string;
12
+ order: {
13
+ readonly type: "asc";
14
+ readonly caseSensitive: false;
15
+ readonly natural: true;
16
+ };
17
+ };
18
+ dependenciesTypes: {
19
+ pathPattern: string;
20
+ order: {
21
+ readonly type: "asc";
22
+ readonly caseSensitive: false;
23
+ readonly natural: true;
24
+ };
25
+ };
26
+ childPackages: {
27
+ pathPattern: string;
28
+ order: {
29
+ readonly type: "asc";
30
+ readonly caseSensitive: false;
31
+ readonly natural: true;
32
+ };
33
+ };
34
+ };
35
+ };
36
+ declare const yamlYarnrcRules: TypedFlatConfigItem;
37
+
38
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys };
@@ -0,0 +1,3 @@
1
+ export { yamlOrder, yamlYarnrcRules, yamlYarnrcSortKeys } from '../chunk-HXCKETJH.js';
2
+ //# sourceMappingURL=yarnrc-yml.js.map
3
+ //# sourceMappingURL=yarnrc-yml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"yarnrc-yml.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkCXG4MLTZ_cjs = require('../chunk-CXG4MLTZ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "defineOverride", {
8
+ enumerable: true,
9
+ get: function () { return chunkCXG4MLTZ_cjs.defineOverride; }
10
+ });
11
+ //# sourceMappingURL=index.cjs.map
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,12 @@
1
+ import { TypedFlatConfigItem, Awaitable } from '@antfu/eslint-config';
2
+
3
+ type OverrideConfig = {
4
+ name: NonNullable<TypedFlatConfigItem['name']>;
5
+ } & ({
6
+ partialConfig: TypedFlatConfigItem;
7
+ } | {
8
+ entireConfig: () => Awaitable<TypedFlatConfigItem>;
9
+ });
10
+ declare const defineOverride: (config: OverrideConfig) => readonly [string, TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>)];
11
+
12
+ export { type OverrideConfig, defineOverride };
@@ -0,0 +1,12 @@
1
+ import { TypedFlatConfigItem, Awaitable } from '@antfu/eslint-config';
2
+
3
+ type OverrideConfig = {
4
+ name: NonNullable<TypedFlatConfigItem['name']>;
5
+ } & ({
6
+ partialConfig: TypedFlatConfigItem;
7
+ } | {
8
+ entireConfig: () => Awaitable<TypedFlatConfigItem>;
9
+ });
10
+ declare const defineOverride: (config: OverrideConfig) => readonly [string, TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>)];
11
+
12
+ export { type OverrideConfig, defineOverride };
@@ -0,0 +1,3 @@
1
+ export { defineOverride } from '../chunk-HTFVO7PM.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@culur/config-eslint",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Culur's eslint configuration",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,7 +13,7 @@
13
13
  "bugs": {
14
14
  "url": "https://github.com/culur/culur/issues"
15
15
  },
16
- "homepage": "https://github.com/culur/culur#readme",
16
+ "homepage": "https://github.com/culur/culur/tree/main/packages/config-eslint#readme",
17
17
  "author": "culur <culur.net@gmail.com>",
18
18
  "license": "MIT",
19
19
  "keywords": [
@@ -34,6 +34,16 @@
34
34
  "types": "./dist/index.d.cts",
35
35
  "default": "./dist/index.cjs"
36
36
  }
37
+ },
38
+ "./*": {
39
+ "import": {
40
+ "types": "./dist/*/index.d.ts",
41
+ "default": "./dist/*/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/*/index.d.cts",
45
+ "default": "./dist/*/index.cjs"
46
+ }
37
47
  }
38
48
  },
39
49
  "files": [
@@ -48,7 +58,9 @@
48
58
  "scripts": {
49
59
  "clean": "rimraf dist",
50
60
  "build": "tsup",
51
- "test": "tsc --noEmit && vitest run"
61
+ "test": "tsc --noEmit && vitest run",
62
+ "🧹 ------- FORMAT ------- 🧹": "",
63
+ "lint:es-in": "eslint-config-inspector"
52
64
  },
53
65
  "volta": {
54
66
  "extends": "../../package.json"
@@ -57,23 +69,26 @@
57
69
  "node": ">=20"
58
70
  },
59
71
  "dependencies": {
60
- "@antfu/eslint-config": "^2.22.0"
72
+ "@antfu/eslint-config": "^2.27.3",
73
+ "@culur/utils-packages": "1.0.5"
61
74
  },
62
75
  "devDependencies": {
63
- "@culur/config-tsup": "1.1.1",
64
- "@culur/config-typescript": "1.0.2",
65
- "@culur/config-vite": "1.0.4",
76
+ "@culur/config-tsup": "1.1.3",
77
+ "@culur/config-typescript": "1.0.4",
78
+ "@culur/config-vite": "1.0.6",
79
+ "@eslint/config-inspector": "^0.5.4",
66
80
  "@eslint/eslintrc": "^3.1.0",
67
- "@types/eslint": "^8.56.10",
68
- "@types/node": "^20.14.10",
69
- "@vitest/coverage-v8": "^2.0.2",
70
- "@vitest/ui": "^2.0.2",
71
- "eslint": "^9.6.0",
81
+ "@types/eslint": "^9.6.1",
82
+ "@types/node": "^20.16.2",
83
+ "@vitest/coverage-v8": "^2.0.5",
84
+ "@vitest/ui": "^2.0.5",
85
+ "@vue/compiler-sfc": "^3.4.38",
86
+ "eslint": "^9.9.1",
72
87
  "rimraf": "^6.0.1",
73
- "tsup": "^8.1.0",
74
- "type-fest": "^4.21.0",
75
- "typescript": "^5.5.3",
76
- "vitest": "^2.0.2"
88
+ "tsup": "^8.2.4",
89
+ "type-fest": "^4.26.0",
90
+ "typescript": "^5.5.4",
91
+ "vitest": "^2.0.5"
77
92
  },
78
93
  "peerDependencies": {
79
94
  "eslint": ">=9.2.0"
package/src/index.test.ts CHANGED
@@ -1,10 +1,23 @@
1
1
  import type antfu from '@antfu/eslint-config';
2
- import { expectTypeOf, it } from 'vitest';
2
+ import { assert, expectTypeOf, it } from 'vitest';
3
3
  import defineConfig from '.';
4
4
 
5
- it('should be valid', () => {
6
- const config = defineConfig();
5
+ it('default config', async () => {
6
+ const config = await defineConfig({ vue: false });
7
7
 
8
- expectTypeOf(config).toEqualTypeOf<ReturnType<typeof antfu>>();
8
+ const configItem = config.find(c => c.name === 'antfu/vue/rules');
9
+ assert(!configItem);
10
+
11
+ expectTypeOf(config).toEqualTypeOf<Awaited<ReturnType<typeof antfu>>>();
12
+ expectTypeOf(defineConfig).toEqualTypeOf<typeof antfu>();
13
+ });
14
+
15
+ it('hasVue() config', async () => {
16
+ const config = await defineConfig({ vue: true });
17
+
18
+ const configItem = config.find(c => c.name === 'antfu/vue/rules');
19
+ assert(configItem && configItem.rules);
20
+
21
+ expectTypeOf(config).toEqualTypeOf<Awaited<ReturnType<typeof antfu>>>();
9
22
  expectTypeOf(defineConfig).toEqualTypeOf<typeof antfu>();
10
23
  });
package/src/index.ts CHANGED
@@ -1,19 +1,31 @@
1
1
  import antfu from '@antfu/eslint-config';
2
- import { sortPackageJson } from './overrides/sort-package-json';
3
- import { unicornFilenameCase } from './rules/unicorn-filename-case';
4
- import { defineOverride } from './overrides/types';
2
+ import { defineHasPackages } from '@culur/utils-packages';
3
+ import { sortPackageJson, vueRules } from './overrides';
4
+ import { defineOverride } from './types';
5
+ import { filenameRules, yamlYarnrcRules } from './rules';
5
6
 
6
7
  export default function defineConfig(
7
8
  ...[options = {}, ...userConfigs]: Parameters<typeof antfu>
8
9
  ) {
9
- return antfu(
10
+ const { hasVue } = defineHasPackages({ vue: !!options.vue });
11
+
12
+ const config = antfu(
10
13
  {
11
14
  isInEditor: false,
12
15
  stylistic: false,
13
16
  formatters: false,
14
17
  ...options,
15
18
  },
16
- unicornFilenameCase,
19
+ filenameRules,
20
+ yamlYarnrcRules,
17
21
  ...userConfigs,
18
- ).override(...defineOverride(sortPackageJson));
22
+ );
23
+
24
+ config.override(...defineOverride(sortPackageJson));
25
+
26
+ if (hasVue()) {
27
+ config.override(...defineOverride(vueRules));
28
+ }
29
+
30
+ return config;
19
31
  }
@@ -0,0 +1,2 @@
1
+ export * from './sort-package-json';
2
+ export * from './vue-rules';
@@ -1,25 +1,27 @@
1
1
  import { sortPackageJson as sortPackageJsonAntfuFunction } from '@antfu/eslint-config';
2
2
  import { assert, it } from 'vitest';
3
3
  import { sortPackageJson as sortPackageJsonLocalOverride } from './sort-package-json';
4
+ import { defineOverride } from '~/types';
4
5
 
5
6
  it('should be valid rule', async () => {
6
- const [sortPackageJsonAntfu] = await sortPackageJsonAntfuFunction();
7
+ const [configAntfu] = await sortPackageJsonAntfuFunction();
7
8
 
8
- const sortPackageJsonLocal =
9
- typeof sortPackageJsonLocalOverride.config === 'function'
10
- ? await sortPackageJsonLocalOverride.config()
11
- : sortPackageJsonLocalOverride.config;
9
+ const [name, config] = defineOverride(sortPackageJsonLocalOverride);
12
10
 
13
- assert(sortPackageJsonLocal.rules);
14
- assert(sortPackageJsonAntfu.rules);
11
+ assert(name === 'antfu/sort/package-json');
12
+ assert(typeof config === 'function');
13
+ const configLocal = await config();
14
+
15
+ assert(configLocal.rules);
16
+ assert(configAntfu.rules);
15
17
 
16
18
  assert.deepEqual(
17
- sortPackageJsonLocal.rules['jsonc/sort-array-values'],
18
- sortPackageJsonAntfu.rules['jsonc/sort-array-values'],
19
+ configLocal.rules['jsonc/sort-array-values'],
20
+ configAntfu.rules['jsonc/sort-array-values'],
19
21
  );
20
22
 
21
23
  assert.containsAllKeys(
22
- sortPackageJsonLocal.rules,
23
- Object.keys(sortPackageJsonAntfu.rules),
24
+ configLocal.rules, //
25
+ Object.keys(configAntfu.rules),
24
26
  );
25
27
  });
@@ -1,10 +1,10 @@
1
1
  import assert from 'node:assert';
2
2
  import { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';
3
- import type { OverrideConfig } from './types';
3
+ import type { OverrideConfig } from '~/types';
4
4
 
5
5
  export const sortPackageJson: OverrideConfig = {
6
6
  name: 'antfu/sort/package-json',
7
- async config() {
7
+ async entireConfig() {
8
8
  const [configItem] = await sortPackageJsonAntfu();
9
9
  assert(typeof configItem.name === 'string');
10
10
  assert(typeof configItem.rules === 'object');
@@ -0,0 +1,19 @@
1
+ import { assert, it } from 'vitest';
2
+ import { vueRules } from './vue-rules';
3
+ import { defineOverride } from '~/types';
4
+
5
+ it('should be valid rule', async () => {
6
+ assert('partialConfig' in vueRules);
7
+ const [name, config] = defineOverride(vueRules);
8
+
9
+ assert(name === 'antfu/vue/rules');
10
+ assert(typeof config === 'object');
11
+ const configLocal = config;
12
+
13
+ assert(configLocal.rules);
14
+
15
+ assert.containsAllKeys(configLocal.rules, [
16
+ 'vue/singleline-html-element-content-newline',
17
+ 'vue/multiline-html-element-content-newline',
18
+ ]);
19
+ });
@@ -0,0 +1,17 @@
1
+ import type { OverrideConfig } from '~/types';
2
+
3
+ export const vueRules: OverrideConfig = {
4
+ name: 'antfu/vue/rules',
5
+ partialConfig: {
6
+ rules: {
7
+ 'vue/singleline-html-element-content-newline': 'off',
8
+ 'vue/multiline-html-element-content-newline': 'off',
9
+ 'vue/padding-line-between-blocks': ['error', 'always'],
10
+ 'vue/component-name-in-template-casing': [
11
+ 'error',
12
+ 'PascalCase',
13
+ { registeredComponentsOnly: false },
14
+ ],
15
+ },
16
+ },
17
+ };
@@ -1,7 +1,7 @@
1
1
  import { expectTypeOf, it } from 'vitest';
2
2
  import type { TypedFlatConfigItem } from '@antfu/eslint-config';
3
- import { unicornFilenameCase } from './unicorn-filename-case';
3
+ import { filenameRules } from './filename';
4
4
 
5
5
  it('should be valid rule', async () => {
6
- expectTypeOf(unicornFilenameCase).toEqualTypeOf<TypedFlatConfigItem>();
6
+ expectTypeOf(filenameRules).toEqualTypeOf<TypedFlatConfigItem>();
7
7
  });
@@ -0,0 +1,23 @@
1
+ import type { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ export const filenameRules: TypedFlatConfigItem = {
4
+ name: 'culur/filename/rules',
5
+ files: [
6
+ '**/*.?(c|m){js,ts}',
7
+ '**/*.vue',
8
+ '**/*.md?(x)',
9
+ '**/*.json?(c)',
10
+ '**/*.y?(a)ml',
11
+ '**/*.gql',
12
+ '**/*.graphql',
13
+ ],
14
+ rules: {
15
+ 'unicorn/filename-case': [
16
+ 'error',
17
+ {
18
+ case: 'kebabCase',
19
+ ignore: ['README.md', 'CHANGELOG.md'],
20
+ },
21
+ ],
22
+ },
23
+ };
@@ -0,0 +1,2 @@
1
+ export * from './filename';
2
+ export * from './yarnrc-yml';
@@ -0,0 +1,7 @@
1
+ import { expectTypeOf, it } from 'vitest';
2
+ import type { TypedFlatConfigItem } from '@antfu/eslint-config';
3
+ import { yamlYarnrcRules } from './yarnrc-yml';
4
+
5
+ it('should be valid rule', async () => {
6
+ expectTypeOf(yamlYarnrcRules).toEqualTypeOf<TypedFlatConfigItem>();
7
+ });