@so1ve/eslint-config 1.0.0-alpha.16 → 1.0.0-alpha.17

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
@@ -935,7 +935,6 @@ const toml = ({ overrides } = {}) => [
935
935
  }
936
936
  ];
937
937
 
938
- const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
939
938
  const renameRules = (rules, from, to) => Object.fromEntries(
940
939
  Object.entries(rules).map(([key, value]) => {
941
940
  if (key.startsWith(from)) {
@@ -1594,7 +1593,7 @@ function so1ve(options = {}, ...userConfigs) {
1594
1593
  if (Object.keys(fusedConfig).length > 0) {
1595
1594
  configs.push([fusedConfig]);
1596
1595
  }
1597
- const merged = combine(...configs, ...userConfigs);
1596
+ const merged = [...configs, ...userConfigs].flat();
1598
1597
  return merged;
1599
1598
  }
1600
1599
 
@@ -1752,7 +1751,6 @@ exports.GLOB_TSCONFIG = GLOB_TSCONFIG;
1752
1751
  exports.GLOB_TSX = GLOB_TSX;
1753
1752
  exports.GLOB_VUE = GLOB_VUE;
1754
1753
  exports.GLOB_YAML = GLOB_YAML;
1755
- exports.combine = combine;
1756
1754
  exports.comments = comments;
1757
1755
  exports.formatting = formatting;
1758
1756
  exports.html = html;
package/dist/index.d.ts CHANGED
@@ -36,11 +36,15 @@ export { default as parserVue } from 'vue-eslint-parser';
36
36
  export { default as parserYaml } from 'yaml-eslint-parser';
37
37
 
38
38
  interface OptionsComponentExts {
39
- /** Additional extensions for components. */
39
+ /**
40
+ * Additional extensions for components.
41
+ */
40
42
  componentExts?: string[];
41
43
  }
42
44
  interface OptionsTypeScriptParserOptions {
43
- /** Additional parser options for TypeScript. */
45
+ /**
46
+ * Additional parser options for TypeScript.
47
+ */
44
48
  parserOptions?: Partial<ParserOptions>;
45
49
  }
46
50
  interface OptionsHasTypeScript {
@@ -115,7 +119,9 @@ interface Options extends OptionsComponentExts {
115
119
  * @default true
116
120
  */
117
121
  formatting?: boolean;
118
- /** Provide overrides for rules for each integration. */
122
+ /**
123
+ * Provide overrides for rules for each integration.
124
+ */
119
125
  overrides?: {
120
126
  javascript?: ConfigItem["rules"];
121
127
  typescript?: ConfigItem["rules"];
@@ -182,7 +188,9 @@ declare const vue: ({ overrides, typescript, }?: OptionsHasTypeScript & OptionsO
182
188
 
183
189
  declare const yaml: ({ overrides }?: OptionsOverrides) => ConfigItem[];
184
190
 
185
- /** Construct an array of ESLint flat config items. */
191
+ /**
192
+ * Construct an array of ESLint flat config items.
193
+ */
186
194
  declare function so1ve(options?: Options, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
187
195
 
188
196
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -212,8 +220,6 @@ declare const GLOB_TESTS: string[];
212
220
  declare const GLOB_ALL_SRC: string[];
213
221
  declare const GLOB_EXCLUDE: string[];
214
222
 
215
- /** Combine array and non-array configs into a single array. */
216
- declare const combine: (...configs: (ConfigItem | ConfigItem[])[]) => ConfigItem[];
217
223
  declare const renameRules: (rules: Record<string, any>, from: string, to: string) => {
218
224
  [k: string]: any;
219
225
  };
@@ -221,4 +227,4 @@ declare function recordRulesStateConfigs(configs: ConfigItem[]): ConfigItem[];
221
227
  declare function recordRulesState(rules: ConfigItem["rules"]): ConfigItem["rules"];
222
228
  declare function warnUnnecessaryOffRules(): void;
223
229
 
224
- export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, RenamedRules, combine, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
230
+ export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, RenamedRules, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
package/dist/index.mjs CHANGED
@@ -924,7 +924,6 @@ const toml = ({ overrides } = {}) => [
924
924
  }
925
925
  ];
926
926
 
927
- const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
928
927
  const renameRules = (rules, from, to) => Object.fromEntries(
929
928
  Object.entries(rules).map(([key, value]) => {
930
929
  if (key.startsWith(from)) {
@@ -1583,8 +1582,8 @@ function so1ve(options = {}, ...userConfigs) {
1583
1582
  if (Object.keys(fusedConfig).length > 0) {
1584
1583
  configs.push([fusedConfig]);
1585
1584
  }
1586
- const merged = combine(...configs, ...userConfigs);
1585
+ const merged = [...configs, ...userConfigs].flat();
1587
1586
  return merged;
1588
1587
  }
1589
1588
 
1590
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, combine, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
1589
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-config",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "description": "Ray's eslint config.",
6
6
  "keywords": [
@@ -70,8 +70,8 @@
70
70
  "toml-eslint-parser": "^0.6.0",
71
71
  "vue-eslint-parser": "^9.3.1",
72
72
  "yaml-eslint-parser": "^1.2.2",
73
- "@so1ve/eslint-plugin": "1.0.0-alpha.16",
74
- "@so1ve/eslint-plugin-sort-imports": "1.0.0-alpha.16"
73
+ "@so1ve/eslint-plugin": "1.0.0-alpha.17",
74
+ "@so1ve/eslint-plugin-sort-imports": "1.0.0-alpha.17"
75
75
  },
76
76
  "devDependencies": {
77
77
  "eslint": "^8.46.0"