@html-validate/eslint-config 5.4.17 → 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 +127 -37
- package/dist/cli.js.map +2 -2
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
}
|
18
18
|
return to;
|
19
19
|
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
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
|
+
));
|
21
24
|
|
22
25
|
// ../../node_modules/argparse/lib/sub.js
|
23
26
|
var require_sub = __commonJS({
|
@@ -408,7 +411,13 @@ var require_argparse = __commonJS({
|
|
408
411
|
try {
|
409
412
|
let name = object.constructor.name;
|
410
413
|
Object.defineProperty(object, from, {
|
411
|
-
value: util.deprecate(object[to], sub(
|
414
|
+
value: util.deprecate(object[to], sub(
|
415
|
+
"%s.%s() is renamed to %s.%s()",
|
416
|
+
name,
|
417
|
+
from,
|
418
|
+
name,
|
419
|
+
to
|
420
|
+
)),
|
412
421
|
enumerable: false
|
413
422
|
});
|
414
423
|
} catch {
|
@@ -469,7 +478,11 @@ var require_argparse = __commonJS({
|
|
469
478
|
}
|
470
479
|
if (renames.length) {
|
471
480
|
let name = get_name();
|
472
|
-
deprecate("camelcase_" + name, sub(
|
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
|
+
));
|
473
486
|
}
|
474
487
|
let missing_positionals = [];
|
475
488
|
let positional_count = args2.length;
|
@@ -490,7 +503,11 @@ var require_argparse = __commonJS({
|
|
490
503
|
}
|
491
504
|
if (renames2.length) {
|
492
505
|
let name = get_name();
|
493
|
-
deprecate("camelcase_" + name, sub(
|
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
|
+
));
|
494
511
|
}
|
495
512
|
result.push(kwargs);
|
496
513
|
kwargs = {};
|
@@ -512,19 +529,36 @@ var require_argparse = __commonJS({
|
|
512
529
|
}
|
513
530
|
}
|
514
531
|
if (Object.keys(kwargs).length) {
|
515
|
-
throw new TypeError(sub(
|
532
|
+
throw new TypeError(sub(
|
533
|
+
"%s() got an unexpected keyword argument %r",
|
534
|
+
get_name(),
|
535
|
+
Object.keys(kwargs)[0]
|
536
|
+
));
|
516
537
|
}
|
517
538
|
if (args2.length) {
|
518
539
|
let from = Object.entries(descriptor).filter(([k, v]) => k[0] !== "*" && v !== no_default).length;
|
519
540
|
let to = Object.entries(descriptor).filter(([k]) => k[0] !== "*").length;
|
520
|
-
throw new TypeError(sub(
|
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
|
+
));
|
521
549
|
}
|
522
550
|
if (missing_positionals.length) {
|
523
551
|
let strs = missing_positionals.map(repr);
|
524
552
|
if (strs.length > 1)
|
525
553
|
strs[strs.length - 1] = "and " + strs[strs.length - 1];
|
526
554
|
let str_joined = strs.join(strs.length === 2 ? "" : ", ");
|
527
|
-
throw new TypeError(sub(
|
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
|
+
));
|
528
562
|
}
|
529
563
|
return result;
|
530
564
|
}
|
@@ -591,7 +625,10 @@ var require_argparse = __commonJS({
|
|
591
625
|
}
|
592
626
|
this._prog = prog;
|
593
627
|
this._indent_increment = indent_increment;
|
594
|
-
this._max_help_position = Math.min(
|
628
|
+
this._max_help_position = Math.min(
|
629
|
+
max_help_position,
|
630
|
+
Math.max(width - 20, indent_increment * 2)
|
631
|
+
);
|
595
632
|
this._width = width;
|
596
633
|
this._current_indent = 0;
|
597
634
|
this._level = 0;
|
@@ -642,7 +679,10 @@ var require_argparse = __commonJS({
|
|
642
679
|
}
|
643
680
|
let invocation_length = Math.max(...invocations.map((invocation) => invocation.length));
|
644
681
|
let action_length = invocation_length + this._current_indent;
|
645
|
-
this._action_max_length = Math.max(
|
682
|
+
this._action_max_length = Math.max(
|
683
|
+
this._action_max_length,
|
684
|
+
action_length
|
685
|
+
);
|
646
686
|
this._add_item(this._format_action.bind(this), [action]);
|
647
687
|
}
|
648
688
|
}
|
@@ -841,7 +881,10 @@ var require_argparse = __commonJS({
|
|
841
881
|
return this._fill_text(text, text_width, indent) + "\n\n";
|
842
882
|
}
|
843
883
|
_format_action(action) {
|
844
|
-
let help_position = Math.min(
|
884
|
+
let help_position = Math.min(
|
885
|
+
this._action_max_length + 2,
|
886
|
+
this._max_help_position
|
887
|
+
);
|
845
888
|
let help_width = Math.max(this._width - help_position, 11);
|
846
889
|
let action_width = help_position - this._current_indent - 2;
|
847
890
|
let action_header = this._format_action_invocation(action);
|
@@ -1761,7 +1804,10 @@ var require_argparse = __commonJS({
|
|
1761
1804
|
this.register("action", "extend", _ExtendAction);
|
1762
1805
|
["storeConst", "storeTrue", "storeFalse", "appendConst"].forEach((old_name) => {
|
1763
1806
|
let new_name = _to_new_name(old_name);
|
1764
|
-
this.register("action", old_name, util.deprecate(
|
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
|
+
));
|
1765
1811
|
});
|
1766
1812
|
this._get_handler();
|
1767
1813
|
this._actions = [];
|
@@ -1805,9 +1851,12 @@ var require_argparse = __commonJS({
|
|
1805
1851
|
});
|
1806
1852
|
if (args2.length === 1 && Array.isArray(args2[0])) {
|
1807
1853
|
args2 = args2[0];
|
1808
|
-
deprecate(
|
1809
|
-
|
1810
|
-
|
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
|
+
);
|
1811
1860
|
}
|
1812
1861
|
let chars = this.prefix_chars;
|
1813
1862
|
if (!args2.length || args2.length === 1 && !chars.includes(args2[0][0])) {
|
@@ -2118,10 +2167,16 @@ var require_argparse = __commonJS({
|
|
2118
2167
|
version: void 0
|
2119
2168
|
});
|
2120
2169
|
if (debug !== void 0) {
|
2121
|
-
deprecate(
|
2170
|
+
deprecate(
|
2171
|
+
"debug",
|
2172
|
+
'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'
|
2173
|
+
);
|
2122
2174
|
}
|
2123
2175
|
if (version !== void 0) {
|
2124
|
-
deprecate(
|
2176
|
+
deprecate(
|
2177
|
+
"version",
|
2178
|
+
`The "version" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead.`
|
2179
|
+
);
|
2125
2180
|
}
|
2126
2181
|
super({
|
2127
2182
|
description,
|
@@ -2165,22 +2220,34 @@ var require_argparse = __commonJS({
|
|
2165
2220
|
return result;
|
2166
2221
|
});
|
2167
2222
|
this.register("type", "str", String);
|
2168
|
-
this.register(
|
2223
|
+
this.register(
|
2224
|
+
"type",
|
2225
|
+
"string",
|
2226
|
+
util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')
|
2227
|
+
);
|
2169
2228
|
let default_prefix = prefix_chars.includes("-") ? "-" : prefix_chars[0];
|
2170
2229
|
if (this.add_help) {
|
2171
|
-
this.add_argument(
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
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
|
+
);
|
2176
2239
|
}
|
2177
2240
|
if (version) {
|
2178
|
-
this.add_argument(
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
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
|
+
);
|
2184
2251
|
}
|
2185
2252
|
for (let parent of parents) {
|
2186
2253
|
this._add_container_actions(parent);
|
@@ -2417,7 +2484,9 @@ var require_argparse = __commonJS({
|
|
2417
2484
|
let start_index = 0;
|
2418
2485
|
let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number));
|
2419
2486
|
while (start_index <= max_option_string_index) {
|
2420
|
-
let next_option_string_index = Math.min(
|
2487
|
+
let next_option_string_index = Math.min(
|
2488
|
+
...Object.keys(option_string_indices).map(Number).filter((index) => index >= start_index)
|
2489
|
+
);
|
2421
2490
|
if (start_index !== next_option_string_index) {
|
2422
2491
|
let positionals_end_index = consume_positionals(start_index);
|
2423
2492
|
if (positionals_end_index > start_index) {
|
@@ -2443,13 +2512,20 @@ var require_argparse = __commonJS({
|
|
2443
2512
|
required_actions.push(_get_action_name(action));
|
2444
2513
|
} else {
|
2445
2514
|
if (action.default !== void 0 && typeof action.default === "string" && hasattr(namespace, action.dest) && action.default === getattr(namespace, action.dest)) {
|
2446
|
-
setattr(
|
2515
|
+
setattr(
|
2516
|
+
namespace,
|
2517
|
+
action.dest,
|
2518
|
+
this._get_value(action, action.default)
|
2519
|
+
);
|
2447
2520
|
}
|
2448
2521
|
}
|
2449
2522
|
}
|
2450
2523
|
}
|
2451
2524
|
if (required_actions.length) {
|
2452
|
-
this.error(sub(
|
2525
|
+
this.error(sub(
|
2526
|
+
"the following arguments are required: %s",
|
2527
|
+
required_actions.join(", ")
|
2528
|
+
));
|
2453
2529
|
}
|
2454
2530
|
for (let group of this._mutually_exclusive_groups) {
|
2455
2531
|
if (group.required) {
|
@@ -2670,7 +2746,10 @@ var require_argparse = __commonJS({
|
|
2670
2746
|
action.save_default = action.default;
|
2671
2747
|
action.default = SUPPRESS;
|
2672
2748
|
}
|
2673
|
-
[namespace, remaining_args] = this.parse_known_args(
|
2749
|
+
[namespace, remaining_args] = this.parse_known_args(
|
2750
|
+
args2,
|
2751
|
+
namespace
|
2752
|
+
);
|
2674
2753
|
for (let action of positionals) {
|
2675
2754
|
let attr = getattr(namespace, action.dest);
|
2676
2755
|
if (Array.isArray(attr) && attr.length === 0) {
|
@@ -2694,7 +2773,10 @@ var require_argparse = __commonJS({
|
|
2694
2773
|
group.save_required = group.required;
|
2695
2774
|
group.required = false;
|
2696
2775
|
}
|
2697
|
-
[namespace, extras] = this.parse_known_args(
|
2776
|
+
[namespace, extras] = this.parse_known_args(
|
2777
|
+
remaining_args,
|
2778
|
+
namespace
|
2779
|
+
);
|
2698
2780
|
} finally {
|
2699
2781
|
for (let action of optionals) {
|
2700
2782
|
action.required = action.save_required;
|
@@ -2796,12 +2878,20 @@ var require_argparse = __commonJS({
|
|
2796
2878
|
}
|
2797
2879
|
format_usage() {
|
2798
2880
|
let formatter = this._get_formatter();
|
2799
|
-
formatter.add_usage(
|
2881
|
+
formatter.add_usage(
|
2882
|
+
this.usage,
|
2883
|
+
this._actions,
|
2884
|
+
this._mutually_exclusive_groups
|
2885
|
+
);
|
2800
2886
|
return formatter.format_help();
|
2801
2887
|
}
|
2802
2888
|
format_help() {
|
2803
2889
|
let formatter = this._get_formatter();
|
2804
|
-
formatter.add_usage(
|
2890
|
+
formatter.add_usage(
|
2891
|
+
this.usage,
|
2892
|
+
this._actions,
|
2893
|
+
this._mutually_exclusive_groups
|
2894
|
+
);
|
2805
2895
|
formatter.add_text(this.description);
|
2806
2896
|
for (let action_group of this._action_groups) {
|
2807
2897
|
formatter.start_section(action_group.title);
|
@@ -8880,7 +8970,7 @@ var require_package = __commonJS({
|
|
8880
8970
|
"package.json"(exports, module2) {
|
8881
8971
|
module2.exports = {
|
8882
8972
|
name: "@html-validate/eslint-config",
|
8883
|
-
version: "5.4.
|
8973
|
+
version: "5.4.17",
|
8884
8974
|
description: "Eslint sharable config used by the various HTML-validate packages",
|
8885
8975
|
keywords: [
|
8886
8976
|
"eslint"
|
@@ -8914,7 +9004,7 @@ var require_package = __commonJS({
|
|
8914
9004
|
},
|
8915
9005
|
dependencies: {
|
8916
9006
|
"@rushstack/eslint-patch": "1.1.4",
|
8917
|
-
eslint: "8.
|
9007
|
+
eslint: "8.21.0",
|
8918
9008
|
"eslint-config-prettier": "8.5.0",
|
8919
9009
|
"eslint-config-sidvind": "1.3.2",
|
8920
9010
|
"eslint-formatter-gitlab": "3.0.0",
|