@html-validate/eslint-config 5.7.3 → 5.9.0
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 +61 -24
- package/dist/cli.js.map +3 -3
- package/package.json +3 -3
- package/template/eslintignore +1 -0
- package/template/eslintrc.js.njk +16 -2
package/dist/cli.js
CHANGED
@@ -3555,9 +3555,10 @@ var require_lib = __commonJS({
|
|
3555
3555
|
'"': """,
|
3556
3556
|
"'": "'",
|
3557
3557
|
"<": "<",
|
3558
|
-
">": ">"
|
3558
|
+
">": ">",
|
3559
|
+
"\\": "\"
|
3559
3560
|
};
|
3560
|
-
var escapeRegex = /[&"'
|
3561
|
+
var escapeRegex = /[&"'<>\\]/g;
|
3561
3562
|
var _exports = module2.exports = {};
|
3562
3563
|
function hasOwnProp(obj, k) {
|
3563
3564
|
return ObjProto.hasOwnProperty.call(obj, k);
|
@@ -4458,7 +4459,7 @@ var require_object = __commonJS({
|
|
4458
4459
|
descriptor.configurable = true;
|
4459
4460
|
if ("value" in descriptor)
|
4460
4461
|
descriptor.writable = true;
|
4461
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
4462
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
4462
4463
|
}
|
4463
4464
|
}
|
4464
4465
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -4466,15 +4467,32 @@ var require_object = __commonJS({
|
|
4466
4467
|
_defineProperties(Constructor.prototype, protoProps);
|
4467
4468
|
if (staticProps)
|
4468
4469
|
_defineProperties(Constructor, staticProps);
|
4470
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
4469
4471
|
return Constructor;
|
4470
4472
|
}
|
4473
|
+
function _toPropertyKey(arg) {
|
4474
|
+
var key = _toPrimitive(arg, "string");
|
4475
|
+
return typeof key === "symbol" ? key : String(key);
|
4476
|
+
}
|
4477
|
+
function _toPrimitive(input, hint) {
|
4478
|
+
if (typeof input !== "object" || input === null)
|
4479
|
+
return input;
|
4480
|
+
var prim = input[Symbol.toPrimitive];
|
4481
|
+
if (prim !== void 0) {
|
4482
|
+
var res = prim.call(input, hint || "default");
|
4483
|
+
if (typeof res !== "object")
|
4484
|
+
return res;
|
4485
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
4486
|
+
}
|
4487
|
+
return (hint === "string" ? String : Number)(input);
|
4488
|
+
}
|
4471
4489
|
function _inheritsLoose(subClass, superClass) {
|
4472
4490
|
subClass.prototype = Object.create(superClass.prototype);
|
4473
4491
|
subClass.prototype.constructor = subClass;
|
4474
4492
|
_setPrototypeOf(subClass, superClass);
|
4475
4493
|
}
|
4476
4494
|
function _setPrototypeOf(o, p) {
|
4477
|
-
_setPrototypeOf = Object.setPrototypeOf
|
4495
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
4478
4496
|
o2.__proto__ = p2;
|
4479
4497
|
return o2;
|
4480
4498
|
};
|
@@ -4582,7 +4600,7 @@ var require_nodes = __commonJS({
|
|
4582
4600
|
descriptor.configurable = true;
|
4583
4601
|
if ("value" in descriptor)
|
4584
4602
|
descriptor.writable = true;
|
4585
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
4603
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
4586
4604
|
}
|
4587
4605
|
}
|
4588
4606
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -4590,15 +4608,32 @@ var require_nodes = __commonJS({
|
|
4590
4608
|
_defineProperties(Constructor.prototype, protoProps);
|
4591
4609
|
if (staticProps)
|
4592
4610
|
_defineProperties(Constructor, staticProps);
|
4611
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
4593
4612
|
return Constructor;
|
4594
4613
|
}
|
4614
|
+
function _toPropertyKey(arg) {
|
4615
|
+
var key = _toPrimitive(arg, "string");
|
4616
|
+
return typeof key === "symbol" ? key : String(key);
|
4617
|
+
}
|
4618
|
+
function _toPrimitive(input, hint) {
|
4619
|
+
if (typeof input !== "object" || input === null)
|
4620
|
+
return input;
|
4621
|
+
var prim = input[Symbol.toPrimitive];
|
4622
|
+
if (prim !== void 0) {
|
4623
|
+
var res = prim.call(input, hint || "default");
|
4624
|
+
if (typeof res !== "object")
|
4625
|
+
return res;
|
4626
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
4627
|
+
}
|
4628
|
+
return (hint === "string" ? String : Number)(input);
|
4629
|
+
}
|
4595
4630
|
function _inheritsLoose(subClass, superClass) {
|
4596
4631
|
subClass.prototype = Object.create(superClass.prototype);
|
4597
4632
|
subClass.prototype.constructor = subClass;
|
4598
4633
|
_setPrototypeOf(subClass, superClass);
|
4599
4634
|
}
|
4600
4635
|
function _setPrototypeOf(o, p) {
|
4601
|
-
_setPrototypeOf = Object.setPrototypeOf
|
4636
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
4602
4637
|
o2.__proto__ = p2;
|
4603
4638
|
return o2;
|
4604
4639
|
};
|
@@ -4702,7 +4737,7 @@ var require_nodes = __commonJS({
|
|
4702
4737
|
}(Node);
|
4703
4738
|
var Root = NodeList.extend("Root");
|
4704
4739
|
var Literal = Value.extend("Literal");
|
4705
|
-
var
|
4740
|
+
var _Symbol = Value.extend("Symbol");
|
4706
4741
|
var Group = NodeList.extend("Group");
|
4707
4742
|
var ArrayNode = NodeList.extend("Array");
|
4708
4743
|
var Pair = Node.extend("Pair", {
|
@@ -4884,7 +4919,7 @@ var require_nodes = __commonJS({
|
|
4884
4919
|
NodeList,
|
4885
4920
|
Value,
|
4886
4921
|
Literal,
|
4887
|
-
Symbol:
|
4922
|
+
Symbol: _Symbol,
|
4888
4923
|
Group,
|
4889
4924
|
Array: ArrayNode,
|
4890
4925
|
Pair,
|
@@ -4949,7 +4984,7 @@ var require_parser = __commonJS({
|
|
4949
4984
|
_setPrototypeOf(subClass, superClass);
|
4950
4985
|
}
|
4951
4986
|
function _setPrototypeOf(o, p) {
|
4952
|
-
_setPrototypeOf = Object.setPrototypeOf
|
4987
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
4953
4988
|
o2.__proto__ = p2;
|
4954
4989
|
return o2;
|
4955
4990
|
};
|
@@ -6367,7 +6402,7 @@ var require_compiler = __commonJS({
|
|
6367
6402
|
_setPrototypeOf(subClass, superClass);
|
6368
6403
|
}
|
6369
6404
|
function _setPrototypeOf(o, p) {
|
6370
|
-
_setPrototypeOf = Object.setPrototypeOf
|
6405
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
6371
6406
|
o2.__proto__ = p2;
|
6372
6407
|
return o2;
|
6373
6408
|
};
|
@@ -7802,7 +7837,7 @@ var require_loader = __commonJS({
|
|
7802
7837
|
_setPrototypeOf(subClass, superClass);
|
7803
7838
|
}
|
7804
7839
|
function _setPrototypeOf(o, p) {
|
7805
|
-
_setPrototypeOf = Object.setPrototypeOf
|
7840
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
7806
7841
|
o2.__proto__ = p2;
|
7807
7842
|
return o2;
|
7808
7843
|
};
|
@@ -7838,7 +7873,7 @@ var require_precompiled_loader = __commonJS({
|
|
7838
7873
|
_setPrototypeOf(subClass, superClass);
|
7839
7874
|
}
|
7840
7875
|
function _setPrototypeOf(o, p) {
|
7841
|
-
_setPrototypeOf = Object.setPrototypeOf
|
7876
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
7842
7877
|
o2.__proto__ = p2;
|
7843
7878
|
return o2;
|
7844
7879
|
};
|
@@ -13106,7 +13141,7 @@ var require_node_loaders = __commonJS({
|
|
13106
13141
|
_setPrototypeOf(subClass, superClass);
|
13107
13142
|
}
|
13108
13143
|
function _setPrototypeOf(o, p) {
|
13109
|
-
_setPrototypeOf = Object.setPrototypeOf
|
13144
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
13110
13145
|
o2.__proto__ = p2;
|
13111
13146
|
return o2;
|
13112
13147
|
};
|
@@ -13461,7 +13496,7 @@ var require_environment = __commonJS({
|
|
13461
13496
|
_setPrototypeOf(subClass, superClass);
|
13462
13497
|
}
|
13463
13498
|
function _setPrototypeOf(o, p) {
|
13464
|
-
_setPrototypeOf = Object.setPrototypeOf
|
13499
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
13465
13500
|
o2.__proto__ = p2;
|
13466
13501
|
return o2;
|
13467
13502
|
};
|
@@ -14445,7 +14480,7 @@ var require_package = __commonJS({
|
|
14445
14480
|
"package.json"(exports, module2) {
|
14446
14481
|
module2.exports = {
|
14447
14482
|
name: "@html-validate/eslint-config",
|
14448
|
-
version: "5.
|
14483
|
+
version: "5.8.0",
|
14449
14484
|
description: "Eslint sharable config used by the various HTML-validate packages",
|
14450
14485
|
keywords: [
|
14451
14486
|
"eslint"
|
@@ -14496,7 +14531,7 @@ var require_package = __commonJS({
|
|
14496
14531
|
devDependencies: {
|
14497
14532
|
argparse: "2.0.1",
|
14498
14533
|
"find-up": "5.0.0",
|
14499
|
-
nunjucks: "3.2.
|
14534
|
+
nunjucks: "3.2.4"
|
14500
14535
|
},
|
14501
14536
|
peerDependencies: {
|
14502
14537
|
prettier: ">= 2"
|
@@ -14530,12 +14565,11 @@ async function renderPassthru(src) {
|
|
14530
14565
|
}
|
14531
14566
|
async function renderNunjucks(src, dst, features) {
|
14532
14567
|
import_nunjucks.default.configure(import_path.default.dirname(src), { trimBlocks: true });
|
14533
|
-
const overrides = Object.values(features).some(Boolean);
|
14534
14568
|
const typeinfo = features.typeinfo ? {
|
14535
14569
|
rootDir: import_path.default.dirname(features.typeinfo),
|
14536
14570
|
tsconfig: `./${import_path.default.basename(features.typeinfo)}`
|
14537
14571
|
} : false;
|
14538
|
-
const context = { ...features,
|
14572
|
+
const context = { ...features, typeinfo };
|
14539
14573
|
const result = import_nunjucks.default.render(import_path.default.basename(src), context);
|
14540
14574
|
const prettierConfig = await import_prettier.default.resolveConfig(dst, {
|
14541
14575
|
editorconfig: true
|
@@ -14550,7 +14584,6 @@ async function renderNunjucks(src, dst, features) {
|
|
14550
14584
|
var pkg = require_package();
|
14551
14585
|
var exec = (0, import_util.promisify)(import_child_process.default.exec);
|
14552
14586
|
var templateDir = import_path2.default.join(__dirname, "../template");
|
14553
|
-
var FILES = [".eslintrc.js", ".eslintignore"];
|
14554
14587
|
var PACKAGE_JSON = "package.json";
|
14555
14588
|
async function getRootDir() {
|
14556
14589
|
const pkgFile = await (0, import_find_up.default)(PACKAGE_JSON);
|
@@ -14561,7 +14594,7 @@ async function getRootDir() {
|
|
14561
14594
|
return import_path2.default.dirname(pkgFile);
|
14562
14595
|
}
|
14563
14596
|
function resolveTemplate(originalFilename) {
|
14564
|
-
const filename = originalFilename.replace(/^\./, "");
|
14597
|
+
const filename = originalFilename.replace(/^\./, "").replace(/\.cjs$/, ".js");
|
14565
14598
|
const literal = import_path2.default.join(templateDir, filename);
|
14566
14599
|
if (import_fs2.default.existsSync(literal)) {
|
14567
14600
|
return [literal, renderPassthru];
|
@@ -14675,11 +14708,15 @@ async function ensurePkgScript(script, command, options) {
|
|
14675
14708
|
}
|
14676
14709
|
async function writeConfig(options, features) {
|
14677
14710
|
await ensureFileRemoved(".eslintrc.json", options);
|
14678
|
-
|
14679
|
-
|
14711
|
+
if (import_fs2.default.existsSync(import_path2.default.join(options.rootDir, ".eslintrc.js"))) {
|
14712
|
+
console.log(`Deprecated: project uses ".eslintrc.js" instead of ".eslintrc.cjs".`);
|
14713
|
+
await ensureFileExists(".eslintrc.js", options, features);
|
14714
|
+
} else {
|
14715
|
+
await ensureFileExists(".eslintrc.cjs", options, features);
|
14680
14716
|
}
|
14681
|
-
await
|
14682
|
-
await ensurePkgScript("eslint
|
14717
|
+
await ensureFileExists(".eslintignore", options, features);
|
14718
|
+
await ensurePkgScript("eslint", "eslint --cache .", options);
|
14719
|
+
await ensurePkgScript("eslint:fix", "eslint --cache --fix .", options);
|
14683
14720
|
await ensureDependencyRemoved("eslint", options);
|
14684
14721
|
await ensureDependencyExists("@html-validate/eslint-config", options);
|
14685
14722
|
if (features.typeinfo) {
|