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

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
@@ -19,6 +19,7 @@ var pluginJsonSchemaValidator = require('eslint-plugin-json-schema-validator');
19
19
  var pluginJsonc = require('eslint-plugin-jsonc');
20
20
  var pluginMdx = require('eslint-plugin-mdx');
21
21
  var pluginNode = require('eslint-plugin-n');
22
+ var pluginNoAwaitInPromise = require('eslint-plugin-no-await-in-promise');
22
23
  var pluginNoOnlyTests = require('eslint-plugin-no-only-tests');
23
24
  var pluginOnlyError = require('eslint-plugin-only-error');
24
25
  var pluginPromise = require('eslint-plugin-promise');
@@ -41,6 +42,24 @@ var localPkg = require('local-pkg');
41
42
 
42
43
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
43
44
 
45
+ function _interopNamespace(e) {
46
+ if (e && e.__esModule) return e;
47
+ var n = Object.create(null);
48
+ if (e) {
49
+ Object.keys(e).forEach(function (k) {
50
+ if (k !== 'default') {
51
+ var d = Object.getOwnPropertyDescriptor(e, k);
52
+ Object.defineProperty(n, k, d.get ? d : {
53
+ enumerable: true,
54
+ get: function () { return e[k]; }
55
+ });
56
+ }
57
+ });
58
+ }
59
+ n["default"] = e;
60
+ return Object.freeze(n);
61
+ }
62
+
44
63
  var pluginComments__default = /*#__PURE__*/_interopDefaultLegacy(pluginComments);
45
64
  var pluginHtml__default = /*#__PURE__*/_interopDefaultLegacy(pluginHtml);
46
65
  var parserHtml__default = /*#__PURE__*/_interopDefaultLegacy(parserHtml);
@@ -58,6 +77,7 @@ var pluginJsonSchemaValidator__default = /*#__PURE__*/_interopDefaultLegacy(plug
58
77
  var pluginJsonc__default = /*#__PURE__*/_interopDefaultLegacy(pluginJsonc);
59
78
  var pluginMdx__default = /*#__PURE__*/_interopDefaultLegacy(pluginMdx);
60
79
  var pluginNode__default = /*#__PURE__*/_interopDefaultLegacy(pluginNode);
80
+ var pluginNoAwaitInPromise__namespace = /*#__PURE__*/_interopNamespace(pluginNoAwaitInPromise);
61
81
  var pluginNoOnlyTests__default = /*#__PURE__*/_interopDefaultLegacy(pluginNoOnlyTests);
62
82
  var pluginOnlyError__default = /*#__PURE__*/_interopDefaultLegacy(pluginOnlyError);
63
83
  var pluginPromise__default = /*#__PURE__*/_interopDefaultLegacy(pluginPromise);
@@ -420,7 +440,8 @@ const javascript = ({
420
440
  "sort-imports": pluginSortImports__default["default"],
421
441
  "array-func": pluginArrayFunc__default["default"],
422
442
  "json-schema-validator": pluginJsonSchemaValidator__default["default"],
423
- "regexp": pluginRegexp__default["default"]
443
+ "regexp": pluginRegexp__default["default"],
444
+ "no-await-in-promise": pluginNoAwaitInPromise__namespace
424
445
  }
425
446
  },
426
447
  {
@@ -725,10 +746,19 @@ const javascript = ({
725
746
  "sort-imports/exports": "error",
726
747
  // array-func
727
748
  "array-func/prefer-array-from": "off",
749
+ "array-func/prefer-flat": "off",
750
+ // Handled by unicorn
751
+ "array-func/from-map": "off",
752
+ // Conflicts with unicorn/prefer-spread
753
+ "array-func/no-unnecessary-this-arg": "error",
754
+ "array-func/avoid-reverse": "error",
755
+ "array-func/prefer-flat-map": "error",
728
756
  // json-schema-validator
729
757
  "json-schema-validator/no-invalid": "warn",
730
758
  // regexp
731
759
  "regexp/no-unused-capturing-group": "warn",
760
+ // no-await-in-promise
761
+ "no-await-in-promise/no-await-in-promise": "error",
732
762
  ...overrides
733
763
  }
734
764
  },
@@ -935,7 +965,6 @@ const toml = ({ overrides } = {}) => [
935
965
  }
936
966
  ];
937
967
 
938
- const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
939
968
  const renameRules = (rules, from, to) => Object.fromEntries(
940
969
  Object.entries(rules).map(([key, value]) => {
941
970
  if (key.startsWith(from)) {
@@ -1594,7 +1623,7 @@ function so1ve(options = {}, ...userConfigs) {
1594
1623
  if (Object.keys(fusedConfig).length > 0) {
1595
1624
  configs.push([fusedConfig]);
1596
1625
  }
1597
- const merged = combine(...configs, ...userConfigs);
1626
+ const merged = [...configs, ...userConfigs].flat();
1598
1627
  return merged;
1599
1628
  }
1600
1629
 
@@ -1666,6 +1695,7 @@ Object.defineProperty(exports, 'pluginNode', {
1666
1695
  enumerable: true,
1667
1696
  get: function () { return pluginNode__default["default"]; }
1668
1697
  });
1698
+ exports.pluginNoAwaitInPromise = pluginNoAwaitInPromise__namespace;
1669
1699
  Object.defineProperty(exports, 'pluginNoOnlyTests', {
1670
1700
  enumerable: true,
1671
1701
  get: function () { return pluginNoOnlyTests__default["default"]; }
@@ -1752,7 +1782,6 @@ exports.GLOB_TSCONFIG = GLOB_TSCONFIG;
1752
1782
  exports.GLOB_TSX = GLOB_TSX;
1753
1783
  exports.GLOB_VUE = GLOB_VUE;
1754
1784
  exports.GLOB_YAML = GLOB_YAML;
1755
- exports.combine = combine;
1756
1785
  exports.comments = comments;
1757
1786
  exports.formatting = formatting;
1758
1787
  exports.html = html;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { default as pluginJsonSchemaValidator } from 'eslint-plugin-json-schema-
19
19
  export { default as pluginJsonc } from 'eslint-plugin-jsonc';
20
20
  export { default as pluginMdx } from 'eslint-plugin-mdx';
21
21
  export { default as pluginNode } from 'eslint-plugin-n';
22
+ import * as eslintPluginNoAwaitInPromise from 'eslint-plugin-no-await-in-promise';
23
+ export { eslintPluginNoAwaitInPromise as pluginNoAwaitInPromise };
22
24
  export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
23
25
  export { default as pluginOnlyError } from 'eslint-plugin-only-error';
24
26
  export { default as pluginPromise } from 'eslint-plugin-promise';
@@ -36,11 +38,15 @@ export { default as parserVue } from 'vue-eslint-parser';
36
38
  export { default as parserYaml } from 'yaml-eslint-parser';
37
39
 
38
40
  interface OptionsComponentExts {
39
- /** Additional extensions for components. */
41
+ /**
42
+ * Additional extensions for components.
43
+ */
40
44
  componentExts?: string[];
41
45
  }
42
46
  interface OptionsTypeScriptParserOptions {
43
- /** Additional parser options for TypeScript. */
47
+ /**
48
+ * Additional parser options for TypeScript.
49
+ */
44
50
  parserOptions?: Partial<ParserOptions>;
45
51
  }
46
52
  interface OptionsHasTypeScript {
@@ -115,7 +121,9 @@ interface Options extends OptionsComponentExts {
115
121
  * @default true
116
122
  */
117
123
  formatting?: boolean;
118
- /** Provide overrides for rules for each integration. */
124
+ /**
125
+ * Provide overrides for rules for each integration.
126
+ */
119
127
  overrides?: {
120
128
  javascript?: ConfigItem["rules"];
121
129
  typescript?: ConfigItem["rules"];
@@ -182,7 +190,9 @@ declare const vue: ({ overrides, typescript, }?: OptionsHasTypeScript & OptionsO
182
190
 
183
191
  declare const yaml: ({ overrides }?: OptionsOverrides) => ConfigItem[];
184
192
 
185
- /** Construct an array of ESLint flat config items. */
193
+ /**
194
+ * Construct an array of ESLint flat config items.
195
+ */
186
196
  declare function so1ve(options?: Options, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
187
197
 
188
198
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -212,8 +222,6 @@ declare const GLOB_TESTS: string[];
212
222
  declare const GLOB_ALL_SRC: string[];
213
223
  declare const GLOB_EXCLUDE: string[];
214
224
 
215
- /** Combine array and non-array configs into a single array. */
216
- declare const combine: (...configs: (ConfigItem | ConfigItem[])[]) => ConfigItem[];
217
225
  declare const renameRules: (rules: Record<string, any>, from: string, to: string) => {
218
226
  [k: string]: any;
219
227
  };
@@ -221,4 +229,4 @@ declare function recordRulesStateConfigs(configs: ConfigItem[]): ConfigItem[];
221
229
  declare function recordRulesState(rules: ConfigItem["rules"]): ConfigItem["rules"];
222
230
  declare function warnUnnecessaryOffRules(): void;
223
231
 
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 };
232
+ 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
@@ -31,6 +31,8 @@ import pluginMdx from 'eslint-plugin-mdx';
31
31
  export { default as pluginMdx } from 'eslint-plugin-mdx';
32
32
  import pluginNode from 'eslint-plugin-n';
33
33
  export { default as pluginNode } from 'eslint-plugin-n';
34
+ import * as pluginNoAwaitInPromise from 'eslint-plugin-no-await-in-promise';
35
+ export { pluginNoAwaitInPromise };
34
36
  import pluginNoOnlyTests from 'eslint-plugin-no-only-tests';
35
37
  export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
36
38
  import pluginOnlyError from 'eslint-plugin-only-error';
@@ -409,7 +411,8 @@ const javascript = ({
409
411
  "sort-imports": pluginSortImports,
410
412
  "array-func": pluginArrayFunc,
411
413
  "json-schema-validator": pluginJsonSchemaValidator,
412
- "regexp": pluginRegexp
414
+ "regexp": pluginRegexp,
415
+ "no-await-in-promise": pluginNoAwaitInPromise
413
416
  }
414
417
  },
415
418
  {
@@ -714,10 +717,19 @@ const javascript = ({
714
717
  "sort-imports/exports": "error",
715
718
  // array-func
716
719
  "array-func/prefer-array-from": "off",
720
+ "array-func/prefer-flat": "off",
721
+ // Handled by unicorn
722
+ "array-func/from-map": "off",
723
+ // Conflicts with unicorn/prefer-spread
724
+ "array-func/no-unnecessary-this-arg": "error",
725
+ "array-func/avoid-reverse": "error",
726
+ "array-func/prefer-flat-map": "error",
717
727
  // json-schema-validator
718
728
  "json-schema-validator/no-invalid": "warn",
719
729
  // regexp
720
730
  "regexp/no-unused-capturing-group": "warn",
731
+ // no-await-in-promise
732
+ "no-await-in-promise/no-await-in-promise": "error",
721
733
  ...overrides
722
734
  }
723
735
  },
@@ -924,7 +936,6 @@ const toml = ({ overrides } = {}) => [
924
936
  }
925
937
  ];
926
938
 
927
- const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
928
939
  const renameRules = (rules, from, to) => Object.fromEntries(
929
940
  Object.entries(rules).map(([key, value]) => {
930
941
  if (key.startsWith(from)) {
@@ -1583,8 +1594,8 @@ function so1ve(options = {}, ...userConfigs) {
1583
1594
  if (Object.keys(fusedConfig).length > 0) {
1584
1595
  configs.push([fusedConfig]);
1585
1596
  }
1586
- const merged = combine(...configs, ...userConfigs);
1597
+ const merged = [...configs, ...userConfigs].flat();
1587
1598
  return merged;
1588
1599
  }
1589
1600
 
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 };
1601
+ 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.18",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "description": "Ray's eslint config.",
6
6
  "keywords": [
@@ -52,6 +52,7 @@
52
52
  "eslint-plugin-jsonc": "^2.9.0",
53
53
  "eslint-plugin-mdx": "^2.2.0",
54
54
  "eslint-plugin-n": "^16.0.1",
55
+ "eslint-plugin-no-await-in-promise": "^1.1.5",
55
56
  "eslint-plugin-no-explicit-type-exports": "^0.12.1",
56
57
  "eslint-plugin-no-only-tests": "^3.1.0",
57
58
  "eslint-plugin-only-error": "^1.0.2",
@@ -70,8 +71,8 @@
70
71
  "toml-eslint-parser": "^0.6.0",
71
72
  "vue-eslint-parser": "^9.3.1",
72
73
  "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"
74
+ "@so1ve/eslint-plugin-sort-imports": "1.0.0-alpha.18",
75
+ "@so1ve/eslint-plugin": "1.0.0-alpha.18"
75
76
  },
76
77
  "devDependencies": {
77
78
  "eslint": "^8.46.0"