@html-validate/eslint-config 5.4.12 → 5.4.19

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/cli.js CHANGED
@@ -2,39 +2,10 @@
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
- var __defProps = Object.defineProperties;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
7
  var __getProtoOf = Object.getPrototypeOf;
11
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
9
  var __commonJS = (cb, mod) => function __require() {
39
10
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
40
11
  };
@@ -46,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
46
17
  }
47
18
  return to;
48
19
  };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
50
24
 
51
25
  // ../../node_modules/argparse/lib/sub.js
52
26
  var require_sub = __commonJS({
@@ -266,12 +240,12 @@ var require_textwrap = __commonJS({
266
240
  }
267
241
  };
268
242
  function wrap(text, options = {}) {
269
- let _a = options, { width = 70 } = _a, kwargs = __objRest(_a, ["width"]);
243
+ let { width = 70, ...kwargs } = options;
270
244
  let w = new TextWrapper(Object.assign({ width }, kwargs));
271
245
  return w.wrap(text);
272
246
  }
273
247
  function fill(text, options = {}) {
274
- let _a = options, { width = 70 } = _a, kwargs = __objRest(_a, ["width"]);
248
+ let { width = 70, ...kwargs } = options;
275
249
  let w = new TextWrapper(Object.assign({ width }, kwargs));
276
250
  return w.fill(text);
277
251
  }
@@ -437,7 +411,13 @@ var require_argparse = __commonJS({
437
411
  try {
438
412
  let name = object.constructor.name;
439
413
  Object.defineProperty(object, from, {
440
- value: util.deprecate(object[to], sub("%s.%s() is renamed to %s.%s()", name, from, name, to)),
414
+ value: util.deprecate(object[to], sub(
415
+ "%s.%s() is renamed to %s.%s()",
416
+ name,
417
+ from,
418
+ name,
419
+ to
420
+ )),
441
421
  enumerable: false
442
422
  });
443
423
  } catch {
@@ -498,7 +478,11 @@ var require_argparse = __commonJS({
498
478
  }
499
479
  if (renames.length) {
500
480
  let name = get_name();
501
- deprecate("camelcase_" + name, sub("%s(): following options are renamed: %s", name, renames.map(([a, b]) => sub("%r -> %r", a, b))));
481
+ deprecate("camelcase_" + name, sub(
482
+ "%s(): following options are renamed: %s",
483
+ name,
484
+ renames.map(([a, b]) => sub("%r -> %r", a, b))
485
+ ));
502
486
  }
503
487
  let missing_positionals = [];
504
488
  let positional_count = args2.length;
@@ -519,7 +503,11 @@ var require_argparse = __commonJS({
519
503
  }
520
504
  if (renames2.length) {
521
505
  let name = get_name();
522
- deprecate("camelcase_" + name, sub("%s(): following options are renamed: %s", name, renames2.map(([a, b]) => sub("%r -> %r", a, b))));
506
+ deprecate("camelcase_" + name, sub(
507
+ "%s(): following options are renamed: %s",
508
+ name,
509
+ renames2.map(([a, b]) => sub("%r -> %r", a, b))
510
+ ));
523
511
  }
524
512
  result.push(kwargs);
525
513
  kwargs = {};
@@ -541,19 +529,36 @@ var require_argparse = __commonJS({
541
529
  }
542
530
  }
543
531
  if (Object.keys(kwargs).length) {
544
- throw new TypeError(sub("%s() got an unexpected keyword argument %r", get_name(), Object.keys(kwargs)[0]));
532
+ throw new TypeError(sub(
533
+ "%s() got an unexpected keyword argument %r",
534
+ get_name(),
535
+ Object.keys(kwargs)[0]
536
+ ));
545
537
  }
546
538
  if (args2.length) {
547
539
  let from = Object.entries(descriptor).filter(([k, v]) => k[0] !== "*" && v !== no_default).length;
548
540
  let to = Object.entries(descriptor).filter(([k]) => k[0] !== "*").length;
549
- throw new TypeError(sub("%s() takes %s positional argument%s but %s %s given", get_name(), from === to ? sub("from %s to %s", from, to) : to, from === to && to === 1 ? "" : "s", positional_count, positional_count === 1 ? "was" : "were"));
541
+ throw new TypeError(sub(
542
+ "%s() takes %s positional argument%s but %s %s given",
543
+ get_name(),
544
+ from === to ? sub("from %s to %s", from, to) : to,
545
+ from === to && to === 1 ? "" : "s",
546
+ positional_count,
547
+ positional_count === 1 ? "was" : "were"
548
+ ));
550
549
  }
551
550
  if (missing_positionals.length) {
552
551
  let strs = missing_positionals.map(repr);
553
552
  if (strs.length > 1)
554
553
  strs[strs.length - 1] = "and " + strs[strs.length - 1];
555
554
  let str_joined = strs.join(strs.length === 2 ? "" : ", ");
556
- throw new TypeError(sub("%s() missing %i required positional argument%s: %s", get_name(), strs.length, strs.length === 1 ? "" : "s", str_joined));
555
+ throw new TypeError(sub(
556
+ "%s() missing %i required positional argument%s: %s",
557
+ get_name(),
558
+ strs.length,
559
+ strs.length === 1 ? "" : "s",
560
+ str_joined
561
+ ));
557
562
  }
558
563
  return result;
559
564
  }
@@ -620,7 +625,10 @@ var require_argparse = __commonJS({
620
625
  }
621
626
  this._prog = prog;
622
627
  this._indent_increment = indent_increment;
623
- this._max_help_position = Math.min(max_help_position, Math.max(width - 20, indent_increment * 2));
628
+ this._max_help_position = Math.min(
629
+ max_help_position,
630
+ Math.max(width - 20, indent_increment * 2)
631
+ );
624
632
  this._width = width;
625
633
  this._current_indent = 0;
626
634
  this._level = 0;
@@ -671,7 +679,10 @@ var require_argparse = __commonJS({
671
679
  }
672
680
  let invocation_length = Math.max(...invocations.map((invocation) => invocation.length));
673
681
  let action_length = invocation_length + this._current_indent;
674
- this._action_max_length = Math.max(this._action_max_length, action_length);
682
+ this._action_max_length = Math.max(
683
+ this._action_max_length,
684
+ action_length
685
+ );
675
686
  this._add_item(this._format_action.bind(this), [action]);
676
687
  }
677
688
  }
@@ -870,7 +881,10 @@ var require_argparse = __commonJS({
870
881
  return this._fill_text(text, text_width, indent) + "\n\n";
871
882
  }
872
883
  _format_action(action) {
873
- let help_position = Math.min(this._action_max_length + 2, this._max_help_position);
884
+ let help_position = Math.min(
885
+ this._action_max_length + 2,
886
+ this._max_help_position
887
+ );
874
888
  let help_width = Math.max(this._width - help_position, 11);
875
889
  let action_width = help_position - this._current_indent - 2;
876
890
  let action_header = this._format_action_invocation(action);
@@ -1790,7 +1804,10 @@ var require_argparse = __commonJS({
1790
1804
  this.register("action", "extend", _ExtendAction);
1791
1805
  ["storeConst", "storeTrue", "storeFalse", "appendConst"].forEach((old_name) => {
1792
1806
  let new_name = _to_new_name(old_name);
1793
- this.register("action", old_name, util.deprecate(this._registry_get("action", new_name), sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name)));
1807
+ this.register("action", old_name, util.deprecate(
1808
+ this._registry_get("action", new_name),
1809
+ sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name)
1810
+ ));
1794
1811
  });
1795
1812
  this._get_handler();
1796
1813
  this._actions = [];
@@ -1834,9 +1851,12 @@ var require_argparse = __commonJS({
1834
1851
  });
1835
1852
  if (args2.length === 1 && Array.isArray(args2[0])) {
1836
1853
  args2 = args2[0];
1837
- deprecate("argument-array", sub("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })", {
1838
- args: args2.map(repr).join(", ")
1839
- }));
1854
+ deprecate(
1855
+ "argument-array",
1856
+ sub("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })", {
1857
+ args: args2.map(repr).join(", ")
1858
+ })
1859
+ );
1840
1860
  }
1841
1861
  let chars = this.prefix_chars;
1842
1862
  if (!args2.length || args2.length === 1 && !chars.includes(args2[0][0])) {
@@ -2147,10 +2167,16 @@ var require_argparse = __commonJS({
2147
2167
  version: void 0
2148
2168
  });
2149
2169
  if (debug !== void 0) {
2150
- deprecate("debug", 'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.');
2170
+ deprecate(
2171
+ "debug",
2172
+ 'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'
2173
+ );
2151
2174
  }
2152
2175
  if (version !== void 0) {
2153
- deprecate("version", `The "version" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead.`);
2176
+ deprecate(
2177
+ "version",
2178
+ `The "version" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead.`
2179
+ );
2154
2180
  }
2155
2181
  super({
2156
2182
  description,
@@ -2194,22 +2220,34 @@ var require_argparse = __commonJS({
2194
2220
  return result;
2195
2221
  });
2196
2222
  this.register("type", "str", String);
2197
- this.register("type", "string", util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}'));
2223
+ this.register(
2224
+ "type",
2225
+ "string",
2226
+ util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')
2227
+ );
2198
2228
  let default_prefix = prefix_chars.includes("-") ? "-" : prefix_chars[0];
2199
2229
  if (this.add_help) {
2200
- this.add_argument(default_prefix + "h", default_prefix.repeat(2) + "help", {
2201
- action: "help",
2202
- default: SUPPRESS,
2203
- help: "show this help message and exit"
2204
- });
2230
+ this.add_argument(
2231
+ default_prefix + "h",
2232
+ default_prefix.repeat(2) + "help",
2233
+ {
2234
+ action: "help",
2235
+ default: SUPPRESS,
2236
+ help: "show this help message and exit"
2237
+ }
2238
+ );
2205
2239
  }
2206
2240
  if (version) {
2207
- this.add_argument(default_prefix + "v", default_prefix.repeat(2) + "version", {
2208
- action: "version",
2209
- default: SUPPRESS,
2210
- version: this.version,
2211
- help: "show program's version number and exit"
2212
- });
2241
+ this.add_argument(
2242
+ default_prefix + "v",
2243
+ default_prefix.repeat(2) + "version",
2244
+ {
2245
+ action: "version",
2246
+ default: SUPPRESS,
2247
+ version: this.version,
2248
+ help: "show program's version number and exit"
2249
+ }
2250
+ );
2213
2251
  }
2214
2252
  for (let parent of parents) {
2215
2253
  this._add_container_actions(parent);
@@ -2446,7 +2484,9 @@ var require_argparse = __commonJS({
2446
2484
  let start_index = 0;
2447
2485
  let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number));
2448
2486
  while (start_index <= max_option_string_index) {
2449
- let next_option_string_index = Math.min(...Object.keys(option_string_indices).map(Number).filter((index) => index >= start_index));
2487
+ let next_option_string_index = Math.min(
2488
+ ...Object.keys(option_string_indices).map(Number).filter((index) => index >= start_index)
2489
+ );
2450
2490
  if (start_index !== next_option_string_index) {
2451
2491
  let positionals_end_index = consume_positionals(start_index);
2452
2492
  if (positionals_end_index > start_index) {
@@ -2472,13 +2512,20 @@ var require_argparse = __commonJS({
2472
2512
  required_actions.push(_get_action_name(action));
2473
2513
  } else {
2474
2514
  if (action.default !== void 0 && typeof action.default === "string" && hasattr(namespace, action.dest) && action.default === getattr(namespace, action.dest)) {
2475
- setattr(namespace, action.dest, this._get_value(action, action.default));
2515
+ setattr(
2516
+ namespace,
2517
+ action.dest,
2518
+ this._get_value(action, action.default)
2519
+ );
2476
2520
  }
2477
2521
  }
2478
2522
  }
2479
2523
  }
2480
2524
  if (required_actions.length) {
2481
- this.error(sub("the following arguments are required: %s", required_actions.join(", ")));
2525
+ this.error(sub(
2526
+ "the following arguments are required: %s",
2527
+ required_actions.join(", ")
2528
+ ));
2482
2529
  }
2483
2530
  for (let group of this._mutually_exclusive_groups) {
2484
2531
  if (group.required) {
@@ -2699,7 +2746,10 @@ var require_argparse = __commonJS({
2699
2746
  action.save_default = action.default;
2700
2747
  action.default = SUPPRESS;
2701
2748
  }
2702
- [namespace, remaining_args] = this.parse_known_args(args2, namespace);
2749
+ [namespace, remaining_args] = this.parse_known_args(
2750
+ args2,
2751
+ namespace
2752
+ );
2703
2753
  for (let action of positionals) {
2704
2754
  let attr = getattr(namespace, action.dest);
2705
2755
  if (Array.isArray(attr) && attr.length === 0) {
@@ -2723,7 +2773,10 @@ var require_argparse = __commonJS({
2723
2773
  group.save_required = group.required;
2724
2774
  group.required = false;
2725
2775
  }
2726
- [namespace, extras] = this.parse_known_args(remaining_args, namespace);
2776
+ [namespace, extras] = this.parse_known_args(
2777
+ remaining_args,
2778
+ namespace
2779
+ );
2727
2780
  } finally {
2728
2781
  for (let action of optionals) {
2729
2782
  action.required = action.save_required;
@@ -2825,12 +2878,20 @@ var require_argparse = __commonJS({
2825
2878
  }
2826
2879
  format_usage() {
2827
2880
  let formatter = this._get_formatter();
2828
- formatter.add_usage(this.usage, this._actions, this._mutually_exclusive_groups);
2881
+ formatter.add_usage(
2882
+ this.usage,
2883
+ this._actions,
2884
+ this._mutually_exclusive_groups
2885
+ );
2829
2886
  return formatter.format_help();
2830
2887
  }
2831
2888
  format_help() {
2832
2889
  let formatter = this._get_formatter();
2833
- formatter.add_usage(this.usage, this._actions, this._mutually_exclusive_groups);
2890
+ formatter.add_usage(
2891
+ this.usage,
2892
+ this._actions,
2893
+ this._mutually_exclusive_groups
2894
+ );
2834
2895
  formatter.add_text(this.description);
2835
2896
  for (let action_group of this._action_groups) {
2836
2897
  formatter.start_section(action_group.title);
@@ -3052,10 +3113,11 @@ var require_p_locate = __commonJS({
3052
3113
  return false;
3053
3114
  };
3054
3115
  var pLocate = async (iterable, tester, options) => {
3055
- options = __spreadValues({
3116
+ options = {
3056
3117
  concurrency: Infinity,
3057
- preserveOrder: true
3058
- }, options);
3118
+ preserveOrder: true,
3119
+ ...options
3120
+ };
3059
3121
  const limit = pLimit(options.concurrency);
3060
3122
  const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
3061
3123
  const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
@@ -3094,11 +3156,12 @@ var require_locate_path = __commonJS({
3094
3156
  }
3095
3157
  var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
3096
3158
  module2.exports = async (paths, options) => {
3097
- options = __spreadValues({
3159
+ options = {
3098
3160
  cwd: process.cwd(),
3099
3161
  type: "file",
3100
- allowSymlinks: true
3101
- }, options);
3162
+ allowSymlinks: true,
3163
+ ...options
3164
+ };
3102
3165
  checkType(options);
3103
3166
  const statFn = options.allowSymlinks ? fsStat : fsLStat;
3104
3167
  return pLocate(paths, async (path_) => {
@@ -3111,11 +3174,12 @@ var require_locate_path = __commonJS({
3111
3174
  }, options);
3112
3175
  };
3113
3176
  module2.exports.sync = (paths, options) => {
3114
- options = __spreadValues({
3177
+ options = {
3115
3178
  cwd: process.cwd(),
3116
3179
  allowSymlinks: true,
3117
- type: "file"
3118
- }, options);
3180
+ type: "file",
3181
+ ...options
3182
+ };
3119
3183
  checkType(options);
3120
3184
  const statFn = options.allowSymlinks ? fs3.statSync : fs3.lstatSync;
3121
3185
  for (const path_ of paths) {
@@ -3180,7 +3244,7 @@ var require_find_up = __commonJS({
3180
3244
  return foundPath;
3181
3245
  };
3182
3246
  while (true) {
3183
- const foundPath = await runMatcher(__spreadProps(__spreadValues({}, options), { cwd: directory }));
3247
+ const foundPath = await runMatcher({ ...options, cwd: directory });
3184
3248
  if (foundPath === stop) {
3185
3249
  return;
3186
3250
  }
@@ -3208,7 +3272,7 @@ var require_find_up = __commonJS({
3208
3272
  return foundPath;
3209
3273
  };
3210
3274
  while (true) {
3211
- const foundPath = runMatcher(__spreadProps(__spreadValues({}, options), { cwd: directory }));
3275
+ const foundPath = runMatcher({ ...options, cwd: directory });
3212
3276
  if (foundPath === stop) {
3213
3277
  return;
3214
3278
  }
@@ -8906,7 +8970,7 @@ var require_package = __commonJS({
8906
8970
  "package.json"(exports, module2) {
8907
8971
  module2.exports = {
8908
8972
  name: "@html-validate/eslint-config",
8909
- version: "5.4.11",
8973
+ version: "5.4.17",
8910
8974
  description: "Eslint sharable config used by the various HTML-validate packages",
8911
8975
  keywords: [
8912
8976
  "eslint"
@@ -8939,17 +9003,17 @@ var require_package = __commonJS({
8939
9003
  build: "esbuild src/cli.ts --bundle --sourcemap --platform=node --target=node12.22 --external:prettier --outdir=dist"
8940
9004
  },
8941
9005
  dependencies: {
8942
- "@rushstack/eslint-patch": "1.1.3",
8943
- eslint: "8.18.0",
9006
+ "@rushstack/eslint-patch": "1.1.4",
9007
+ eslint: "8.21.0",
8944
9008
  "eslint-config-prettier": "8.5.0",
8945
9009
  "eslint-config-sidvind": "1.3.2",
8946
9010
  "eslint-formatter-gitlab": "3.0.0",
8947
9011
  "eslint-plugin-array-func": "3.1.7",
8948
9012
  "eslint-plugin-import": "2.26.0",
8949
9013
  "eslint-plugin-node": "11.1.0",
8950
- "eslint-plugin-prettier": "4.0.0",
9014
+ "eslint-plugin-prettier": "4.2.1",
8951
9015
  "eslint-plugin-security": "1.5.0",
8952
- "eslint-plugin-sonarjs": "0.13.0"
9016
+ "eslint-plugin-sonarjs": "0.14.0"
8953
9017
  },
8954
9018
  devDependencies: {
8955
9019
  argparse: "2.0.1",
@@ -8993,14 +9057,15 @@ async function renderNunjucks(src, dst, features) {
8993
9057
  rootDir: import_path.default.dirname(features.typeinfo),
8994
9058
  tsconfig: `./${import_path.default.basename(features.typeinfo)}`
8995
9059
  } : false;
8996
- const context = __spreadProps(__spreadValues({}, features), { overrides, typeinfo });
9060
+ const context = { ...features, overrides, typeinfo };
8997
9061
  const result = import_nunjucks.default.render(import_path.default.basename(src), context);
8998
9062
  const prettierConfig = await import_prettier.default.resolveConfig(dst, {
8999
9063
  editorconfig: true
9000
9064
  });
9001
- return import_prettier.default.format(result, __spreadProps(__spreadValues({}, prettierConfig), {
9065
+ return import_prettier.default.format(result, {
9066
+ ...prettierConfig,
9002
9067
  filepath: dst
9003
- }));
9068
+ });
9004
9069
  }
9005
9070
 
9006
9071
  // src/cli.ts
@@ -9173,7 +9238,7 @@ async function getFeatures(options, args2) {
9173
9238
  const dst = import_path2.default.join(options.rootDir, PACKAGE_JSON);
9174
9239
  const data = import_fs2.default.readFileSync(dst, "utf-8");
9175
9240
  const pkg2 = JSON.parse(data);
9176
- const deps = __spreadValues(__spreadValues({}, pkg2.dependencies), pkg2.devDependencies);
9241
+ const deps = { ...pkg2.dependencies, ...pkg2.devDependencies };
9177
9242
  return {
9178
9243
  angularjs: (_a = args2.angularjs) != null ? _a : Boolean(deps.angular),
9179
9244
  cypress: (_b = args2.cypress) != null ? _b : Boolean(deps.cypress),