@vp-tw/eslint-config 0.0.12 → 0.0.14

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.
@@ -70,7 +70,17 @@ const jsoncInternal = (composer, options) => {
70
70
  /**
71
71
  * Default.
72
72
  */
73
- "jsonc/sort-keys": "error",
73
+ "jsonc/sort-keys": [
74
+ "error",
75
+ {
76
+ pathPattern: ".*",
77
+ order: {
78
+ type: "asc",
79
+ caseSensitive: false,
80
+ natural: true
81
+ }
82
+ }
83
+ ],
74
84
  /**
75
85
  * Overridable.
76
86
  */
@@ -131,7 +141,9 @@ const jsoncInternal = (composer, options) => {
131
141
  {
132
142
  pathPattern: ".*",
133
143
  order: {
134
- type: "asc"
144
+ type: "asc",
145
+ caseSensitive: false,
146
+ natural: true
135
147
  }
136
148
  }
137
149
  ],
@@ -24,6 +24,12 @@ const typescriptInternal = (composer, options) => {
24
24
  /**
25
25
  * Default.
26
26
  */
27
+ /**
28
+ * Use `Array<T>` instead of `T[]` for better DX.
29
+ *
30
+ * - [Array<T> vs T[]: Which is better?](https://www.totaltypescript.com/array-types-in-typescript)
31
+ * - [Array Types in TypeScript](https://tkdodo.eu/blog/array-types-in-type-script)
32
+ */
27
33
  "ts/array-type": ["error", { default: "generic" }],
28
34
  /**
29
35
  * Namespaces are useful for centralizing the management of types. Just avoid
@@ -59,7 +59,17 @@ const yamlInternal = (composer, options) => {
59
59
  ...options?.sortKeys,
60
60
  files: [GLOB_PNPM_WORKSPACE_YAML, ...options?.sortKeys?.files ?? []],
61
61
  rules: {
62
- "yaml/sort-keys": ["error", "asc"],
62
+ "yaml/sort-keys": [
63
+ "error",
64
+ {
65
+ pathPattern: ".*",
66
+ order: {
67
+ type: "asc",
68
+ caseSensitive: false,
69
+ natural: true
70
+ }
71
+ }
72
+ ],
63
73
  ...options?.sortKeys?.rules
64
74
  }
65
75
  }
@@ -10,14 +10,11 @@ import { typescript } from "./extends/typescript.mjs";
10
10
  import { yaml } from "./extends/yaml.mjs";
11
11
  import "./eslint-typegen.mjs";
12
12
  const vdustr = (options, ...userConfigs) => {
13
- let config = antfu(
14
- {
15
- // We use `prettier`.
16
- stylistic: false,
17
- ...options
18
- },
19
- ...userConfigs
20
- );
13
+ let config = antfu({
14
+ // We use `prettier`.
15
+ stylistic: false,
16
+ ...options
17
+ });
21
18
  javascript(config, options?.javascriptExtends);
22
19
  imports(config, options?.importsExtends);
23
20
  typescript(config, options?.typescriptExtends);
@@ -62,6 +59,7 @@ const vdustr = (options, ...userConfigs) => {
62
59
  prettier(...!prettierOptions ? [] : [prettierOptions])
63
60
  );
64
61
  }
62
+ config.append(...userConfigs);
65
63
  return config;
66
64
  };
67
65
  export { vdustr };
@@ -66,7 +66,14 @@ const jsoncInternal = (composer, options) => {
66
66
  /**
67
67
  * Default.
68
68
  */
69
- "jsonc/sort-keys": "error",
69
+ "jsonc/sort-keys": ["error", {
70
+ pathPattern: ".*",
71
+ order: {
72
+ type: "asc",
73
+ caseSensitive: false,
74
+ natural: true
75
+ }
76
+ }],
70
77
  /**
71
78
  * Overridable.
72
79
  */
@@ -122,7 +129,9 @@ const jsoncInternal = (composer, options) => {
122
129
  "jsonc/sort-array-values": ["error", {
123
130
  pathPattern: ".*",
124
131
  order: {
125
- type: "asc"
132
+ type: "asc",
133
+ caseSensitive: false,
134
+ natural: true
126
135
  }
127
136
  }],
128
137
  ...options?.sortArrayValues?.rules
@@ -28,6 +28,12 @@ const typescriptInternal = (composer, options) => {
28
28
  /**
29
29
  * Default.
30
30
  */
31
+ /**
32
+ * Use `Array<T>` instead of `T[]` for better DX.
33
+ *
34
+ * - [Array<T> vs T[]: Which is better?](https://www.totaltypescript.com/array-types-in-typescript)
35
+ * - [Array Types in TypeScript](https://tkdodo.eu/blog/array-types-in-type-script)
36
+ */
31
37
  "ts/array-type": ["error", {
32
38
  default: "generic"
33
39
  }],
@@ -56,7 +56,14 @@ const yamlInternal = (composer, options) => {
56
56
  ...options?.sortKeys,
57
57
  files: [_globs.GLOB_PNPM_WORKSPACE_YAML, ...(options?.sortKeys?.files ?? [])],
58
58
  rules: {
59
- "yaml/sort-keys": ["error", "asc"],
59
+ "yaml/sort-keys": ["error", {
60
+ pathPattern: ".*",
61
+ order: {
62
+ type: "asc",
63
+ caseSensitive: false,
64
+ natural: true
65
+ }
66
+ }],
60
67
  ...options?.sortKeys?.rules
61
68
  }
62
69
  }]);
package/dist/vdustr.js CHANGED
@@ -21,7 +21,7 @@ const vdustr = (options, ...userConfigs) => {
21
21
  // We use `prettier`.
22
22
  stylistic: false,
23
23
  ...options
24
- }, ...userConfigs);
24
+ });
25
25
  (0, _javascript.javascript)(config, options?.javascriptExtends);
26
26
  (0, _imports.imports)(config, options?.importsExtends);
27
27
  (0, _typescript.typescript)(config, options?.typescriptExtends);
@@ -58,6 +58,7 @@ const vdustr = (options, ...userConfigs) => {
58
58
  const prettierOptions = typeof options?.prettier !== "object" ? void 0 : options.prettier;
59
59
  config = config.append((0, _prettier.prettier)(...(!prettierOptions ? [] : [prettierOptions])));
60
60
  }
61
+ config.append(...userConfigs);
61
62
  return config;
62
63
  };
63
64
  exports.vdustr = vdustr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vp-tw/eslint-config",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "ViPro's ESLint configuration",
5
5
  "homepage": "https://github.com/vdustr/eslint-config",
6
6
  "author": {