eslint-linter-browserify 9.1.1 → 9.3.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/linter.cjs +570 -383
- package/linter.js +571 -387
- package/linter.min.js +2 -9
- package/linter.mjs +570 -383
- package/package.json +5 -5
package/linter.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.eslint = {}));
|
|
5
|
-
})(this, (function (exports) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('node:path'), require('node:assert')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'node:path', 'node:assert'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.eslint = {}, global.require$$0$5, global.require$$0$4));
|
|
5
|
+
})(this, (function (exports, require$$0$5, require$$0$4) { 'use strict';
|
|
6
6
|
|
|
7
7
|
if (!global) { var global = globalThis || window; }
|
|
8
8
|
|
|
@@ -238,256 +238,6 @@
|
|
|
238
238
|
uptime: uptime
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
242
|
-
//
|
|
243
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
244
|
-
// copy of this software and associated documentation files (the
|
|
245
|
-
// "Software"), to deal in the Software without restriction, including
|
|
246
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
247
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
248
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
249
|
-
// following conditions:
|
|
250
|
-
//
|
|
251
|
-
// The above copyright notice and this permission notice shall be included
|
|
252
|
-
// in all copies or substantial portions of the Software.
|
|
253
|
-
//
|
|
254
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
255
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
256
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
257
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
258
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
259
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
260
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
261
|
-
|
|
262
|
-
// resolves . and .. elements in a path array with directory names there
|
|
263
|
-
// must be no slashes, empty elements, or device names (c:\) in the array
|
|
264
|
-
// (so also no leading and trailing slashes - it does not distinguish
|
|
265
|
-
// relative and absolute paths)
|
|
266
|
-
function normalizeArray(parts, allowAboveRoot) {
|
|
267
|
-
// if the path tries to go above the root, `up` ends up > 0
|
|
268
|
-
var up = 0;
|
|
269
|
-
for (var i = parts.length - 1; i >= 0; i--) {
|
|
270
|
-
var last = parts[i];
|
|
271
|
-
if (last === '.') {
|
|
272
|
-
parts.splice(i, 1);
|
|
273
|
-
} else if (last === '..') {
|
|
274
|
-
parts.splice(i, 1);
|
|
275
|
-
up++;
|
|
276
|
-
} else if (up) {
|
|
277
|
-
parts.splice(i, 1);
|
|
278
|
-
up--;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// if the path is allowed to go above the root, restore leading ..s
|
|
283
|
-
if (allowAboveRoot) {
|
|
284
|
-
for (; up--; up) {
|
|
285
|
-
parts.unshift('..');
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return parts;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// Split a filename into [root, dir, basename, ext], unix version
|
|
293
|
-
// 'root' is just a slash, or nothing.
|
|
294
|
-
var splitPathRe =
|
|
295
|
-
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
|
296
|
-
var splitPath = function(filename) {
|
|
297
|
-
return splitPathRe.exec(filename).slice(1);
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
// path.resolve([from ...], to)
|
|
301
|
-
// posix version
|
|
302
|
-
function resolve() {
|
|
303
|
-
var resolvedPath = '',
|
|
304
|
-
resolvedAbsolute = false;
|
|
305
|
-
|
|
306
|
-
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
307
|
-
var path = (i >= 0) ? arguments[i] : '/';
|
|
308
|
-
|
|
309
|
-
// Skip empty and invalid entries
|
|
310
|
-
if (typeof path !== 'string') {
|
|
311
|
-
throw new TypeError('Arguments to path.resolve must be strings');
|
|
312
|
-
} else if (!path) {
|
|
313
|
-
continue;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
resolvedPath = path + '/' + resolvedPath;
|
|
317
|
-
resolvedAbsolute = path.charAt(0) === '/';
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// At this point the path should be resolved to a full absolute path, but
|
|
321
|
-
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
322
|
-
|
|
323
|
-
// Normalize the path
|
|
324
|
-
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
|
325
|
-
return !!p;
|
|
326
|
-
}), !resolvedAbsolute).join('/');
|
|
327
|
-
|
|
328
|
-
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
|
329
|
-
}
|
|
330
|
-
// path.normalize(path)
|
|
331
|
-
// posix version
|
|
332
|
-
function normalize(path) {
|
|
333
|
-
var isPathAbsolute = isAbsolute(path),
|
|
334
|
-
trailingSlash = substr(path, -1) === '/';
|
|
335
|
-
|
|
336
|
-
// Normalize the path
|
|
337
|
-
path = normalizeArray(filter(path.split('/'), function(p) {
|
|
338
|
-
return !!p;
|
|
339
|
-
}), !isPathAbsolute).join('/');
|
|
340
|
-
|
|
341
|
-
if (!path && !isPathAbsolute) {
|
|
342
|
-
path = '.';
|
|
343
|
-
}
|
|
344
|
-
if (path && trailingSlash) {
|
|
345
|
-
path += '/';
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return (isPathAbsolute ? '/' : '') + path;
|
|
349
|
-
}
|
|
350
|
-
// posix version
|
|
351
|
-
function isAbsolute(path) {
|
|
352
|
-
return path.charAt(0) === '/';
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// posix version
|
|
356
|
-
function join() {
|
|
357
|
-
var paths = Array.prototype.slice.call(arguments, 0);
|
|
358
|
-
return normalize(filter(paths, function(p, index) {
|
|
359
|
-
if (typeof p !== 'string') {
|
|
360
|
-
throw new TypeError('Arguments to path.join must be strings');
|
|
361
|
-
}
|
|
362
|
-
return p;
|
|
363
|
-
}).join('/'));
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
// path.relative(from, to)
|
|
368
|
-
// posix version
|
|
369
|
-
function relative(from, to) {
|
|
370
|
-
from = resolve(from).substr(1);
|
|
371
|
-
to = resolve(to).substr(1);
|
|
372
|
-
|
|
373
|
-
function trim(arr) {
|
|
374
|
-
var start = 0;
|
|
375
|
-
for (; start < arr.length; start++) {
|
|
376
|
-
if (arr[start] !== '') break;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
var end = arr.length - 1;
|
|
380
|
-
for (; end >= 0; end--) {
|
|
381
|
-
if (arr[end] !== '') break;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
if (start > end) return [];
|
|
385
|
-
return arr.slice(start, end - start + 1);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var fromParts = trim(from.split('/'));
|
|
389
|
-
var toParts = trim(to.split('/'));
|
|
390
|
-
|
|
391
|
-
var length = Math.min(fromParts.length, toParts.length);
|
|
392
|
-
var samePartsLength = length;
|
|
393
|
-
for (var i = 0; i < length; i++) {
|
|
394
|
-
if (fromParts[i] !== toParts[i]) {
|
|
395
|
-
samePartsLength = i;
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
var outputParts = [];
|
|
401
|
-
for (var i = samePartsLength; i < fromParts.length; i++) {
|
|
402
|
-
outputParts.push('..');
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
406
|
-
|
|
407
|
-
return outputParts.join('/');
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
var sep = '/';
|
|
411
|
-
var delimiter = ':';
|
|
412
|
-
|
|
413
|
-
function dirname(path) {
|
|
414
|
-
var result = splitPath(path),
|
|
415
|
-
root = result[0],
|
|
416
|
-
dir = result[1];
|
|
417
|
-
|
|
418
|
-
if (!root && !dir) {
|
|
419
|
-
// No dirname whatsoever
|
|
420
|
-
return '.';
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
if (dir) {
|
|
424
|
-
// It has a dirname, strip trailing slash
|
|
425
|
-
dir = dir.substr(0, dir.length - 1);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
return root + dir;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
function basename(path, ext) {
|
|
432
|
-
var f = splitPath(path)[2];
|
|
433
|
-
// TODO: make this comparison case-insensitive on windows?
|
|
434
|
-
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
435
|
-
f = f.substr(0, f.length - ext.length);
|
|
436
|
-
}
|
|
437
|
-
return f;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
function extname(path) {
|
|
442
|
-
return splitPath(path)[3];
|
|
443
|
-
}
|
|
444
|
-
var _polyfillNode_path = {
|
|
445
|
-
extname: extname,
|
|
446
|
-
basename: basename,
|
|
447
|
-
dirname: dirname,
|
|
448
|
-
sep: sep,
|
|
449
|
-
delimiter: delimiter,
|
|
450
|
-
relative: relative,
|
|
451
|
-
join: join,
|
|
452
|
-
isAbsolute: isAbsolute,
|
|
453
|
-
normalize: normalize,
|
|
454
|
-
resolve: resolve
|
|
455
|
-
};
|
|
456
|
-
function filter (xs, f) {
|
|
457
|
-
if (xs.filter) return xs.filter(f);
|
|
458
|
-
var res = [];
|
|
459
|
-
for (var i = 0; i < xs.length; i++) {
|
|
460
|
-
if (f(xs[i], i, xs)) res.push(xs[i]);
|
|
461
|
-
}
|
|
462
|
-
return res;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
// String.prototype.substr - negative index don't work in IE8
|
|
466
|
-
var substr = 'ab'.substr(-1) === 'b' ?
|
|
467
|
-
function (str, start, len) { return str.substr(start, len) } :
|
|
468
|
-
function (str, start, len) {
|
|
469
|
-
if (start < 0) start = str.length + start;
|
|
470
|
-
return str.substr(start, len);
|
|
471
|
-
}
|
|
472
|
-
;
|
|
473
|
-
|
|
474
|
-
var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
475
|
-
__proto__: null,
|
|
476
|
-
basename: basename,
|
|
477
|
-
default: _polyfillNode_path,
|
|
478
|
-
delimiter: delimiter,
|
|
479
|
-
dirname: dirname,
|
|
480
|
-
extname: extname,
|
|
481
|
-
isAbsolute: isAbsolute,
|
|
482
|
-
join: join,
|
|
483
|
-
normalize: normalize,
|
|
484
|
-
relative: relative,
|
|
485
|
-
resolve: resolve,
|
|
486
|
-
sep: sep
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
var require$$0$3 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_path$1);
|
|
490
|
-
|
|
491
241
|
var eslintScope = {};
|
|
492
242
|
|
|
493
243
|
var lookup = [];
|
|
@@ -3672,7 +3422,7 @@
|
|
|
3672
3422
|
throws: throws
|
|
3673
3423
|
});
|
|
3674
3424
|
|
|
3675
|
-
var require$$0$
|
|
3425
|
+
var require$$0$3 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_assert);
|
|
3676
3426
|
|
|
3677
3427
|
var estraverse = {};
|
|
3678
3428
|
|
|
@@ -4692,7 +4442,7 @@
|
|
|
4692
4442
|
|
|
4693
4443
|
Object.defineProperty(eslintScope, '__esModule', { value: true });
|
|
4694
4444
|
|
|
4695
|
-
var assert = require$$0$
|
|
4445
|
+
var assert = require$$0$3;
|
|
4696
4446
|
var estraverse = requireEstraverse();
|
|
4697
4447
|
var esrecurse = requireEsrecurse();
|
|
4698
4448
|
|
|
@@ -17384,7 +17134,7 @@
|
|
|
17384
17134
|
}
|
|
17385
17135
|
|
|
17386
17136
|
var name = "eslint";
|
|
17387
|
-
var version = "9.
|
|
17137
|
+
var version = "9.3.0";
|
|
17388
17138
|
var author = "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>";
|
|
17389
17139
|
var description$2 = "An AST-based pattern checker for JavaScript.";
|
|
17390
17140
|
var bin = {
|
|
@@ -17438,11 +17188,11 @@
|
|
|
17438
17188
|
var dependencies$2 = {
|
|
17439
17189
|
"@eslint-community/eslint-utils": "^4.2.0",
|
|
17440
17190
|
"@eslint-community/regexpp": "^4.6.1",
|
|
17441
|
-
"@eslint/eslintrc": "^3.0
|
|
17442
|
-
"@eslint/js": "9.
|
|
17191
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
17192
|
+
"@eslint/js": "9.3.0",
|
|
17443
17193
|
"@humanwhocodes/config-array": "^0.13.0",
|
|
17444
17194
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
17445
|
-
"@humanwhocodes/retry": "^0.
|
|
17195
|
+
"@humanwhocodes/retry": "^0.3.0",
|
|
17446
17196
|
"@nodelib/fs.walk": "^1.2.8",
|
|
17447
17197
|
ajv: "^6.12.4",
|
|
17448
17198
|
chalk: "^4.0.0",
|
|
@@ -17474,6 +17224,7 @@
|
|
|
17474
17224
|
var devDependencies = {
|
|
17475
17225
|
"@babel/core": "^7.4.3",
|
|
17476
17226
|
"@babel/preset-env": "^7.4.3",
|
|
17227
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
17477
17228
|
"@types/estree": "^1.0.5",
|
|
17478
17229
|
"@types/node": "^20.11.5",
|
|
17479
17230
|
"@wdio/browser-runner": "^8.14.6",
|
|
@@ -17490,12 +17241,11 @@
|
|
|
17490
17241
|
ejs: "^3.0.2",
|
|
17491
17242
|
eslint: "file:.",
|
|
17492
17243
|
"eslint-config-eslint": "file:packages/eslint-config-eslint",
|
|
17493
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
17494
17244
|
"eslint-plugin-eslint-plugin": "^6.0.0",
|
|
17495
17245
|
"eslint-plugin-internal-rules": "file:tools/internal-rules",
|
|
17496
|
-
"eslint-plugin-jsdoc": "^
|
|
17497
|
-
"eslint-plugin-n": "^
|
|
17498
|
-
"eslint-plugin-unicorn": "^
|
|
17246
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
17247
|
+
"eslint-plugin-n": "^17.2.0",
|
|
17248
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
17499
17249
|
"eslint-release": "^3.2.2",
|
|
17500
17250
|
eslump: "^3.0.0",
|
|
17501
17251
|
esprima: "^4.0.1",
|
|
@@ -17512,7 +17262,7 @@
|
|
|
17512
17262
|
"markdown-it": "^12.2.0",
|
|
17513
17263
|
"markdown-it-container": "^3.0.0",
|
|
17514
17264
|
markdownlint: "^0.34.0",
|
|
17515
|
-
"markdownlint-cli": "^0.
|
|
17265
|
+
"markdownlint-cli": "^0.40.0",
|
|
17516
17266
|
marked: "^4.0.8",
|
|
17517
17267
|
metascraper: "^5.25.7",
|
|
17518
17268
|
"metascraper-description": "^5.25.7",
|
|
@@ -17651,6 +17401,256 @@
|
|
|
17651
17401
|
|
|
17652
17402
|
var require$$1$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_util$1);
|
|
17653
17403
|
|
|
17404
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
17405
|
+
//
|
|
17406
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
17407
|
+
// copy of this software and associated documentation files (the
|
|
17408
|
+
// "Software"), to deal in the Software without restriction, including
|
|
17409
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
17410
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
17411
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
17412
|
+
// following conditions:
|
|
17413
|
+
//
|
|
17414
|
+
// The above copyright notice and this permission notice shall be included
|
|
17415
|
+
// in all copies or substantial portions of the Software.
|
|
17416
|
+
//
|
|
17417
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
17418
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17419
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
17420
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
17421
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
17422
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
17423
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17424
|
+
|
|
17425
|
+
// resolves . and .. elements in a path array with directory names there
|
|
17426
|
+
// must be no slashes, empty elements, or device names (c:\) in the array
|
|
17427
|
+
// (so also no leading and trailing slashes - it does not distinguish
|
|
17428
|
+
// relative and absolute paths)
|
|
17429
|
+
function normalizeArray(parts, allowAboveRoot) {
|
|
17430
|
+
// if the path tries to go above the root, `up` ends up > 0
|
|
17431
|
+
var up = 0;
|
|
17432
|
+
for (var i = parts.length - 1; i >= 0; i--) {
|
|
17433
|
+
var last = parts[i];
|
|
17434
|
+
if (last === '.') {
|
|
17435
|
+
parts.splice(i, 1);
|
|
17436
|
+
} else if (last === '..') {
|
|
17437
|
+
parts.splice(i, 1);
|
|
17438
|
+
up++;
|
|
17439
|
+
} else if (up) {
|
|
17440
|
+
parts.splice(i, 1);
|
|
17441
|
+
up--;
|
|
17442
|
+
}
|
|
17443
|
+
}
|
|
17444
|
+
|
|
17445
|
+
// if the path is allowed to go above the root, restore leading ..s
|
|
17446
|
+
if (allowAboveRoot) {
|
|
17447
|
+
for (; up--; up) {
|
|
17448
|
+
parts.unshift('..');
|
|
17449
|
+
}
|
|
17450
|
+
}
|
|
17451
|
+
|
|
17452
|
+
return parts;
|
|
17453
|
+
}
|
|
17454
|
+
|
|
17455
|
+
// Split a filename into [root, dir, basename, ext], unix version
|
|
17456
|
+
// 'root' is just a slash, or nothing.
|
|
17457
|
+
var splitPathRe =
|
|
17458
|
+
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
|
17459
|
+
var splitPath = function(filename) {
|
|
17460
|
+
return splitPathRe.exec(filename).slice(1);
|
|
17461
|
+
};
|
|
17462
|
+
|
|
17463
|
+
// path.resolve([from ...], to)
|
|
17464
|
+
// posix version
|
|
17465
|
+
function resolve() {
|
|
17466
|
+
var resolvedPath = '',
|
|
17467
|
+
resolvedAbsolute = false;
|
|
17468
|
+
|
|
17469
|
+
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
17470
|
+
var path = (i >= 0) ? arguments[i] : '/';
|
|
17471
|
+
|
|
17472
|
+
// Skip empty and invalid entries
|
|
17473
|
+
if (typeof path !== 'string') {
|
|
17474
|
+
throw new TypeError('Arguments to path.resolve must be strings');
|
|
17475
|
+
} else if (!path) {
|
|
17476
|
+
continue;
|
|
17477
|
+
}
|
|
17478
|
+
|
|
17479
|
+
resolvedPath = path + '/' + resolvedPath;
|
|
17480
|
+
resolvedAbsolute = path.charAt(0) === '/';
|
|
17481
|
+
}
|
|
17482
|
+
|
|
17483
|
+
// At this point the path should be resolved to a full absolute path, but
|
|
17484
|
+
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
17485
|
+
|
|
17486
|
+
// Normalize the path
|
|
17487
|
+
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
|
17488
|
+
return !!p;
|
|
17489
|
+
}), !resolvedAbsolute).join('/');
|
|
17490
|
+
|
|
17491
|
+
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
|
17492
|
+
}
|
|
17493
|
+
// path.normalize(path)
|
|
17494
|
+
// posix version
|
|
17495
|
+
function normalize(path) {
|
|
17496
|
+
var isPathAbsolute = isAbsolute(path),
|
|
17497
|
+
trailingSlash = substr(path, -1) === '/';
|
|
17498
|
+
|
|
17499
|
+
// Normalize the path
|
|
17500
|
+
path = normalizeArray(filter(path.split('/'), function(p) {
|
|
17501
|
+
return !!p;
|
|
17502
|
+
}), !isPathAbsolute).join('/');
|
|
17503
|
+
|
|
17504
|
+
if (!path && !isPathAbsolute) {
|
|
17505
|
+
path = '.';
|
|
17506
|
+
}
|
|
17507
|
+
if (path && trailingSlash) {
|
|
17508
|
+
path += '/';
|
|
17509
|
+
}
|
|
17510
|
+
|
|
17511
|
+
return (isPathAbsolute ? '/' : '') + path;
|
|
17512
|
+
}
|
|
17513
|
+
// posix version
|
|
17514
|
+
function isAbsolute(path) {
|
|
17515
|
+
return path.charAt(0) === '/';
|
|
17516
|
+
}
|
|
17517
|
+
|
|
17518
|
+
// posix version
|
|
17519
|
+
function join() {
|
|
17520
|
+
var paths = Array.prototype.slice.call(arguments, 0);
|
|
17521
|
+
return normalize(filter(paths, function(p, index) {
|
|
17522
|
+
if (typeof p !== 'string') {
|
|
17523
|
+
throw new TypeError('Arguments to path.join must be strings');
|
|
17524
|
+
}
|
|
17525
|
+
return p;
|
|
17526
|
+
}).join('/'));
|
|
17527
|
+
}
|
|
17528
|
+
|
|
17529
|
+
|
|
17530
|
+
// path.relative(from, to)
|
|
17531
|
+
// posix version
|
|
17532
|
+
function relative(from, to) {
|
|
17533
|
+
from = resolve(from).substr(1);
|
|
17534
|
+
to = resolve(to).substr(1);
|
|
17535
|
+
|
|
17536
|
+
function trim(arr) {
|
|
17537
|
+
var start = 0;
|
|
17538
|
+
for (; start < arr.length; start++) {
|
|
17539
|
+
if (arr[start] !== '') break;
|
|
17540
|
+
}
|
|
17541
|
+
|
|
17542
|
+
var end = arr.length - 1;
|
|
17543
|
+
for (; end >= 0; end--) {
|
|
17544
|
+
if (arr[end] !== '') break;
|
|
17545
|
+
}
|
|
17546
|
+
|
|
17547
|
+
if (start > end) return [];
|
|
17548
|
+
return arr.slice(start, end - start + 1);
|
|
17549
|
+
}
|
|
17550
|
+
|
|
17551
|
+
var fromParts = trim(from.split('/'));
|
|
17552
|
+
var toParts = trim(to.split('/'));
|
|
17553
|
+
|
|
17554
|
+
var length = Math.min(fromParts.length, toParts.length);
|
|
17555
|
+
var samePartsLength = length;
|
|
17556
|
+
for (var i = 0; i < length; i++) {
|
|
17557
|
+
if (fromParts[i] !== toParts[i]) {
|
|
17558
|
+
samePartsLength = i;
|
|
17559
|
+
break;
|
|
17560
|
+
}
|
|
17561
|
+
}
|
|
17562
|
+
|
|
17563
|
+
var outputParts = [];
|
|
17564
|
+
for (var i = samePartsLength; i < fromParts.length; i++) {
|
|
17565
|
+
outputParts.push('..');
|
|
17566
|
+
}
|
|
17567
|
+
|
|
17568
|
+
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
17569
|
+
|
|
17570
|
+
return outputParts.join('/');
|
|
17571
|
+
}
|
|
17572
|
+
|
|
17573
|
+
var sep = '/';
|
|
17574
|
+
var delimiter = ':';
|
|
17575
|
+
|
|
17576
|
+
function dirname(path) {
|
|
17577
|
+
var result = splitPath(path),
|
|
17578
|
+
root = result[0],
|
|
17579
|
+
dir = result[1];
|
|
17580
|
+
|
|
17581
|
+
if (!root && !dir) {
|
|
17582
|
+
// No dirname whatsoever
|
|
17583
|
+
return '.';
|
|
17584
|
+
}
|
|
17585
|
+
|
|
17586
|
+
if (dir) {
|
|
17587
|
+
// It has a dirname, strip trailing slash
|
|
17588
|
+
dir = dir.substr(0, dir.length - 1);
|
|
17589
|
+
}
|
|
17590
|
+
|
|
17591
|
+
return root + dir;
|
|
17592
|
+
}
|
|
17593
|
+
|
|
17594
|
+
function basename(path, ext) {
|
|
17595
|
+
var f = splitPath(path)[2];
|
|
17596
|
+
// TODO: make this comparison case-insensitive on windows?
|
|
17597
|
+
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
17598
|
+
f = f.substr(0, f.length - ext.length);
|
|
17599
|
+
}
|
|
17600
|
+
return f;
|
|
17601
|
+
}
|
|
17602
|
+
|
|
17603
|
+
|
|
17604
|
+
function extname(path) {
|
|
17605
|
+
return splitPath(path)[3];
|
|
17606
|
+
}
|
|
17607
|
+
var _polyfillNode_path = {
|
|
17608
|
+
extname: extname,
|
|
17609
|
+
basename: basename,
|
|
17610
|
+
dirname: dirname,
|
|
17611
|
+
sep: sep,
|
|
17612
|
+
delimiter: delimiter,
|
|
17613
|
+
relative: relative,
|
|
17614
|
+
join: join,
|
|
17615
|
+
isAbsolute: isAbsolute,
|
|
17616
|
+
normalize: normalize,
|
|
17617
|
+
resolve: resolve
|
|
17618
|
+
};
|
|
17619
|
+
function filter (xs, f) {
|
|
17620
|
+
if (xs.filter) return xs.filter(f);
|
|
17621
|
+
var res = [];
|
|
17622
|
+
for (var i = 0; i < xs.length; i++) {
|
|
17623
|
+
if (f(xs[i], i, xs)) res.push(xs[i]);
|
|
17624
|
+
}
|
|
17625
|
+
return res;
|
|
17626
|
+
}
|
|
17627
|
+
|
|
17628
|
+
// String.prototype.substr - negative index don't work in IE8
|
|
17629
|
+
var substr = 'ab'.substr(-1) === 'b' ?
|
|
17630
|
+
function (str, start, len) { return str.substr(start, len) } :
|
|
17631
|
+
function (str, start, len) {
|
|
17632
|
+
if (start < 0) start = str.length + start;
|
|
17633
|
+
return str.substr(start, len);
|
|
17634
|
+
}
|
|
17635
|
+
;
|
|
17636
|
+
|
|
17637
|
+
var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
17638
|
+
__proto__: null,
|
|
17639
|
+
basename: basename,
|
|
17640
|
+
default: _polyfillNode_path,
|
|
17641
|
+
delimiter: delimiter,
|
|
17642
|
+
dirname: dirname,
|
|
17643
|
+
extname: extname,
|
|
17644
|
+
isAbsolute: isAbsolute,
|
|
17645
|
+
join: join,
|
|
17646
|
+
normalize: normalize,
|
|
17647
|
+
relative: relative,
|
|
17648
|
+
resolve: resolve,
|
|
17649
|
+
sep: sep
|
|
17650
|
+
});
|
|
17651
|
+
|
|
17652
|
+
var require$$0$2 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_path$1);
|
|
17653
|
+
|
|
17654
17654
|
var uri_all = {exports: {}};
|
|
17655
17655
|
|
|
17656
17656
|
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
@@ -27203,7 +27203,7 @@
|
|
|
27203
27203
|
Object.defineProperty(eslintrcUniversal, '__esModule', { value: true });
|
|
27204
27204
|
|
|
27205
27205
|
var util = require$$1$1;
|
|
27206
|
-
var path = require$$0$
|
|
27206
|
+
var path = require$$0$2;
|
|
27207
27207
|
var Ajv = requireAjv$1();
|
|
27208
27208
|
var globals = requireGlobals$1();
|
|
27209
27209
|
|
|
@@ -32798,7 +32798,7 @@
|
|
|
32798
32798
|
// Requirements
|
|
32799
32799
|
//------------------------------------------------------------------------------
|
|
32800
32800
|
|
|
32801
|
-
const assert = require$$0$
|
|
32801
|
+
const assert = require$$0$4;
|
|
32802
32802
|
const { isCommentToken } = requireEslintUtils();
|
|
32803
32803
|
const cursors = requireCursors();
|
|
32804
32804
|
const ForwardTokenCursor = requireForwardTokenCursor();
|
|
@@ -34083,7 +34083,7 @@
|
|
|
34083
34083
|
// Requirements
|
|
34084
34084
|
//------------------------------------------------------------------------------
|
|
34085
34085
|
|
|
34086
|
-
const assert = require$$0$
|
|
34086
|
+
const assert = require$$0$4,
|
|
34087
34087
|
CodePathSegment = requireCodePathSegment();
|
|
34088
34088
|
|
|
34089
34089
|
//------------------------------------------------------------------------------
|
|
@@ -37197,7 +37197,7 @@
|
|
|
37197
37197
|
// Requirements
|
|
37198
37198
|
//------------------------------------------------------------------------------
|
|
37199
37199
|
|
|
37200
|
-
const assert = require$$0$
|
|
37200
|
+
const assert = require$$0$4,
|
|
37201
37201
|
{ breakableTypePattern } = requireAstUtils$1(),
|
|
37202
37202
|
CodePath = requireCodePath(),
|
|
37203
37203
|
CodePathSegment = requireCodePathSegment(),
|
|
@@ -41605,7 +41605,7 @@
|
|
|
41605
41605
|
* https://github.com/eslint/eslint/issues/16302
|
|
41606
41606
|
*/
|
|
41607
41607
|
const configGlobals = Object.assign(
|
|
41608
|
-
|
|
41608
|
+
Object.create(null), // https://github.com/eslint/eslint/issues/18363
|
|
41609
41609
|
getGlobalsForEcmaVersion(languageOptions.ecmaVersion),
|
|
41610
41610
|
languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0,
|
|
41611
41611
|
languageOptions.globals
|
|
@@ -42936,7 +42936,7 @@
|
|
|
42936
42936
|
// Requirements
|
|
42937
42937
|
//------------------------------------------------------------------------------
|
|
42938
42938
|
|
|
42939
|
-
const assert = require$$0$
|
|
42939
|
+
const assert = require$$0$4;
|
|
42940
42940
|
const ruleFixer = requireRuleFixer();
|
|
42941
42941
|
const { interpolate } = requireInterpolate();
|
|
42942
42942
|
|
|
@@ -49717,25 +49717,6 @@
|
|
|
49717
49717
|
return camelcase;
|
|
49718
49718
|
}
|
|
49719
49719
|
|
|
49720
|
-
/**
|
|
49721
|
-
* @fileoverview Pattern for detecting any letter (even letters outside of ASCII).
|
|
49722
|
-
* NOTE: This file was generated using this script in JSCS based on the Unicode 7.0.0 standard: https://github.com/jscs-dev/node-jscs/blob/f5ed14427deb7e7aac84f3056a5aab2d9f3e563e/publish/helpers/generate-patterns.js
|
|
49723
|
-
* Do not edit this file by hand-- please use https://github.com/mathiasbynens/regenerate to regenerate the regular expression exported from this file.
|
|
49724
|
-
* @author Kevin Partington
|
|
49725
|
-
* @license MIT License (from JSCS). See below.
|
|
49726
|
-
*/
|
|
49727
|
-
|
|
49728
|
-
var letters;
|
|
49729
|
-
var hasRequiredLetters;
|
|
49730
|
-
|
|
49731
|
-
function requireLetters () {
|
|
49732
|
-
if (hasRequiredLetters) return letters;
|
|
49733
|
-
hasRequiredLetters = 1;
|
|
49734
|
-
|
|
49735
|
-
letters = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/u;
|
|
49736
|
-
return letters;
|
|
49737
|
-
}
|
|
49738
|
-
|
|
49739
49720
|
/**
|
|
49740
49721
|
* @fileoverview enforce or disallow capitalization of the first letter of a comment
|
|
49741
49722
|
* @author Kevin Partington
|
|
@@ -49752,7 +49733,6 @@
|
|
|
49752
49733
|
// Requirements
|
|
49753
49734
|
//------------------------------------------------------------------------------
|
|
49754
49735
|
|
|
49755
|
-
const LETTER_PATTERN = requireLetters();
|
|
49756
49736
|
const astUtils = requireAstUtils();
|
|
49757
49737
|
|
|
49758
49738
|
//------------------------------------------------------------------------------
|
|
@@ -49761,7 +49741,8 @@
|
|
|
49761
49741
|
|
|
49762
49742
|
const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN,
|
|
49763
49743
|
WHITESPACE = /\s/gu,
|
|
49764
|
-
MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u
|
|
49744
|
+
MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u, // TODO: Combine w/ max-len pattern?
|
|
49745
|
+
LETTER_PATTERN = /\p{L}/u;
|
|
49765
49746
|
|
|
49766
49747
|
/*
|
|
49767
49748
|
* Base schema body for defining the basic capitalization rule, ignorePattern,
|
|
@@ -49977,7 +49958,8 @@
|
|
|
49977
49958
|
return true;
|
|
49978
49959
|
}
|
|
49979
49960
|
|
|
49980
|
-
|
|
49961
|
+
// Get the first Unicode character (1 or 2 code units).
|
|
49962
|
+
const [firstWordChar] = commentWordCharsOnly;
|
|
49981
49963
|
|
|
49982
49964
|
if (!LETTER_PATTERN.test(firstWordChar)) {
|
|
49983
49965
|
return true;
|
|
@@ -50017,12 +49999,14 @@
|
|
|
50017
49999
|
messageId,
|
|
50018
50000
|
fix(fixer) {
|
|
50019
50001
|
const match = comment.value.match(LETTER_PATTERN);
|
|
50002
|
+
const char = match[0];
|
|
50020
50003
|
|
|
50021
|
-
|
|
50004
|
+
// Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*)
|
|
50005
|
+
const charIndex = comment.range[0] + match.index + 2;
|
|
50022
50006
|
|
|
50023
|
-
|
|
50024
|
-
[
|
|
50025
|
-
capitalize === "always" ?
|
|
50007
|
+
return fixer.replaceTextRange(
|
|
50008
|
+
[charIndex, charIndex + char.length],
|
|
50009
|
+
capitalize === "always" ? char.toLocaleUpperCase() : char.toLocaleLowerCase()
|
|
50026
50010
|
);
|
|
50027
50011
|
}
|
|
50028
50012
|
});
|
|
@@ -54735,6 +54719,15 @@
|
|
|
54735
54719
|
allowArrowFunctions: {
|
|
54736
54720
|
type: "boolean",
|
|
54737
54721
|
default: false
|
|
54722
|
+
},
|
|
54723
|
+
overrides: {
|
|
54724
|
+
type: "object",
|
|
54725
|
+
properties: {
|
|
54726
|
+
namedExports: {
|
|
54727
|
+
enum: ["declaration", "expression", "ignore"]
|
|
54728
|
+
}
|
|
54729
|
+
},
|
|
54730
|
+
additionalProperties: false
|
|
54738
54731
|
}
|
|
54739
54732
|
},
|
|
54740
54733
|
additionalProperties: false
|
|
@@ -54752,13 +54745,22 @@
|
|
|
54752
54745
|
const style = context.options[0],
|
|
54753
54746
|
allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions,
|
|
54754
54747
|
enforceDeclarations = (style === "declaration"),
|
|
54748
|
+
exportFunctionStyle = context.options[1] && context.options[1].overrides && context.options[1].overrides.namedExports,
|
|
54755
54749
|
stack = [];
|
|
54756
54750
|
|
|
54757
54751
|
const nodesToCheck = {
|
|
54758
54752
|
FunctionDeclaration(node) {
|
|
54759
54753
|
stack.push(false);
|
|
54760
54754
|
|
|
54761
|
-
if (
|
|
54755
|
+
if (
|
|
54756
|
+
!enforceDeclarations &&
|
|
54757
|
+
node.parent.type !== "ExportDefaultDeclaration" &&
|
|
54758
|
+
(typeof exportFunctionStyle === "undefined" || node.parent.type !== "ExportNamedDeclaration")
|
|
54759
|
+
) {
|
|
54760
|
+
context.report({ node, messageId: "expression" });
|
|
54761
|
+
}
|
|
54762
|
+
|
|
54763
|
+
if (node.parent.type === "ExportNamedDeclaration" && exportFunctionStyle === "expression") {
|
|
54762
54764
|
context.report({ node, messageId: "expression" });
|
|
54763
54765
|
}
|
|
54764
54766
|
},
|
|
@@ -54769,7 +54771,18 @@
|
|
|
54769
54771
|
FunctionExpression(node) {
|
|
54770
54772
|
stack.push(false);
|
|
54771
54773
|
|
|
54772
|
-
if (
|
|
54774
|
+
if (
|
|
54775
|
+
enforceDeclarations &&
|
|
54776
|
+
node.parent.type === "VariableDeclarator" &&
|
|
54777
|
+
(typeof exportFunctionStyle === "undefined" || node.parent.parent.parent.type !== "ExportNamedDeclaration")
|
|
54778
|
+
) {
|
|
54779
|
+
context.report({ node: node.parent, messageId: "declaration" });
|
|
54780
|
+
}
|
|
54781
|
+
|
|
54782
|
+
if (
|
|
54783
|
+
node.parent.type === "VariableDeclarator" && node.parent.parent.parent.type === "ExportNamedDeclaration" &&
|
|
54784
|
+
exportFunctionStyle === "declaration"
|
|
54785
|
+
) {
|
|
54773
54786
|
context.report({ node: node.parent, messageId: "declaration" });
|
|
54774
54787
|
}
|
|
54775
54788
|
},
|
|
@@ -54792,8 +54805,17 @@
|
|
|
54792
54805
|
nodesToCheck["ArrowFunctionExpression:exit"] = function(node) {
|
|
54793
54806
|
const hasThisExpr = stack.pop();
|
|
54794
54807
|
|
|
54795
|
-
if (
|
|
54796
|
-
|
|
54808
|
+
if (!hasThisExpr && node.parent.type === "VariableDeclarator") {
|
|
54809
|
+
if (
|
|
54810
|
+
enforceDeclarations &&
|
|
54811
|
+
(typeof exportFunctionStyle === "undefined" || node.parent.parent.parent.type !== "ExportNamedDeclaration")
|
|
54812
|
+
) {
|
|
54813
|
+
context.report({ node: node.parent, messageId: "declaration" });
|
|
54814
|
+
}
|
|
54815
|
+
|
|
54816
|
+
if (node.parent.parent.parent.type === "ExportNamedDeclaration" && exportFunctionStyle === "declaration") {
|
|
54817
|
+
context.report({ node: node.parent, messageId: "declaration" });
|
|
54818
|
+
}
|
|
54797
54819
|
}
|
|
54798
54820
|
};
|
|
54799
54821
|
}
|
|
@@ -61790,6 +61812,7 @@
|
|
|
61790
61812
|
/**
|
|
61791
61813
|
* @fileoverview Rule to enforce the position of line comments
|
|
61792
61814
|
* @author Alberto Rodríguez
|
|
61815
|
+
* @deprecated in ESLint v9.3.0
|
|
61793
61816
|
*/
|
|
61794
61817
|
|
|
61795
61818
|
var lineCommentPosition;
|
|
@@ -61808,6 +61831,8 @@
|
|
|
61808
61831
|
/** @type {import('../shared/types').Rule} */
|
|
61809
61832
|
lineCommentPosition = {
|
|
61810
61833
|
meta: {
|
|
61834
|
+
deprecated: true,
|
|
61835
|
+
replacedBy: [],
|
|
61811
61836
|
type: "layout",
|
|
61812
61837
|
|
|
61813
61838
|
docs: {
|
|
@@ -65286,6 +65311,7 @@
|
|
|
65286
65311
|
/**
|
|
65287
65312
|
* @fileoverview enforce a particular style for multiline comments
|
|
65288
65313
|
* @author Teddy Katz
|
|
65314
|
+
* @deprecated in ESLint v9.3.0
|
|
65289
65315
|
*/
|
|
65290
65316
|
|
|
65291
65317
|
var multilineCommentStyle;
|
|
@@ -65304,8 +65330,9 @@
|
|
|
65304
65330
|
/** @type {import('../shared/types').Rule} */
|
|
65305
65331
|
multilineCommentStyle = {
|
|
65306
65332
|
meta: {
|
|
65333
|
+
deprecated: true,
|
|
65334
|
+
replacedBy: [],
|
|
65307
65335
|
type: "suggestion",
|
|
65308
|
-
|
|
65309
65336
|
docs: {
|
|
65310
65337
|
description: "Enforce a particular style for multiline comments",
|
|
65311
65338
|
recommended: false,
|
|
@@ -67672,9 +67699,12 @@
|
|
|
67672
67699
|
url: "https://eslint.org/docs/latest/rules/no-case-declarations"
|
|
67673
67700
|
},
|
|
67674
67701
|
|
|
67702
|
+
hasSuggestions: true,
|
|
67703
|
+
|
|
67675
67704
|
schema: [],
|
|
67676
67705
|
|
|
67677
67706
|
messages: {
|
|
67707
|
+
addBrackets: "Add {} brackets around the case block.",
|
|
67678
67708
|
unexpected: "Unexpected lexical declaration in case block."
|
|
67679
67709
|
}
|
|
67680
67710
|
},
|
|
@@ -67706,7 +67736,16 @@
|
|
|
67706
67736
|
if (isLexicalDeclaration(statement)) {
|
|
67707
67737
|
context.report({
|
|
67708
67738
|
node: statement,
|
|
67709
|
-
messageId: "unexpected"
|
|
67739
|
+
messageId: "unexpected",
|
|
67740
|
+
suggest: [
|
|
67741
|
+
{
|
|
67742
|
+
messageId: "addBrackets",
|
|
67743
|
+
fix: fixer => [
|
|
67744
|
+
fixer.insertTextBefore(node.consequent[0], "{ "),
|
|
67745
|
+
fixer.insertTextAfter(node.consequent.at(-1), " }")
|
|
67746
|
+
]
|
|
67747
|
+
}
|
|
67748
|
+
]
|
|
67710
67749
|
});
|
|
67711
67750
|
}
|
|
67712
67751
|
}
|
|
@@ -68649,7 +68688,7 @@
|
|
|
68649
68688
|
* truthiness.
|
|
68650
68689
|
* https://262.ecma-international.org/5.1/#sec-11.9.3
|
|
68651
68690
|
*
|
|
68652
|
-
*
|
|
68691
|
+
* JavaScript `==` operator works by converting the boolean to `1` (true) or
|
|
68653
68692
|
* `+0` (false) and then checks the values `==` equality to that number.
|
|
68654
68693
|
* @param {Scope} scope The scope in which node was found.
|
|
68655
68694
|
* @param {ASTNode} node The node to test.
|
|
@@ -75125,14 +75164,28 @@
|
|
|
75125
75164
|
},
|
|
75126
75165
|
|
|
75127
75166
|
schema: [{
|
|
75128
|
-
|
|
75129
|
-
|
|
75130
|
-
|
|
75131
|
-
|
|
75132
|
-
|
|
75167
|
+
anyOf: [
|
|
75168
|
+
{
|
|
75169
|
+
type: "object",
|
|
75170
|
+
properties: {
|
|
75171
|
+
enforceForInnerExpressions: {
|
|
75172
|
+
type: "boolean"
|
|
75173
|
+
}
|
|
75174
|
+
},
|
|
75175
|
+
additionalProperties: false
|
|
75176
|
+
},
|
|
75177
|
+
|
|
75178
|
+
// deprecated
|
|
75179
|
+
{
|
|
75180
|
+
type: "object",
|
|
75181
|
+
properties: {
|
|
75182
|
+
enforceForLogicalOperands: {
|
|
75183
|
+
type: "boolean"
|
|
75184
|
+
}
|
|
75185
|
+
},
|
|
75186
|
+
additionalProperties: false
|
|
75133
75187
|
}
|
|
75134
|
-
|
|
75135
|
-
additionalProperties: false
|
|
75188
|
+
]
|
|
75136
75189
|
}],
|
|
75137
75190
|
fixable: "code",
|
|
75138
75191
|
|
|
@@ -75144,6 +75197,9 @@
|
|
|
75144
75197
|
|
|
75145
75198
|
create(context) {
|
|
75146
75199
|
const sourceCode = context.sourceCode;
|
|
75200
|
+
const enforceForLogicalOperands = context.options[0]?.enforceForLogicalOperands === true;
|
|
75201
|
+
const enforceForInnerExpressions = context.options[0]?.enforceForInnerExpressions === true;
|
|
75202
|
+
|
|
75147
75203
|
|
|
75148
75204
|
// Node types which have a test which will coerce values to booleans.
|
|
75149
75205
|
const BOOLEAN_NODE_TYPES = new Set([
|
|
@@ -75167,19 +75223,6 @@
|
|
|
75167
75223
|
node.callee.name === "Boolean";
|
|
75168
75224
|
}
|
|
75169
75225
|
|
|
75170
|
-
/**
|
|
75171
|
-
* Checks whether the node is a logical expression and that the option is enabled
|
|
75172
|
-
* @param {ASTNode} node the node
|
|
75173
|
-
* @returns {boolean} if the node is a logical expression and option is enabled
|
|
75174
|
-
*/
|
|
75175
|
-
function isLogicalContext(node) {
|
|
75176
|
-
return node.type === "LogicalExpression" &&
|
|
75177
|
-
(node.operator === "||" || node.operator === "&&") &&
|
|
75178
|
-
(context.options.length && context.options[0].enforceForLogicalOperands === true);
|
|
75179
|
-
|
|
75180
|
-
}
|
|
75181
|
-
|
|
75182
|
-
|
|
75183
75226
|
/**
|
|
75184
75227
|
* Check if a node is in a context where its value would be coerced to a boolean at runtime.
|
|
75185
75228
|
* @param {ASTNode} node The node
|
|
@@ -75210,12 +75253,51 @@
|
|
|
75210
75253
|
return isInFlaggedContext(node.parent);
|
|
75211
75254
|
}
|
|
75212
75255
|
|
|
75213
|
-
|
|
75214
|
-
|
|
75256
|
+
/*
|
|
75257
|
+
* legacy behavior - enforceForLogicalOperands will only recurse on
|
|
75258
|
+
* logical expressions, not on other contexts.
|
|
75259
|
+
* enforceForInnerExpressions will recurse on logical expressions
|
|
75260
|
+
* as well as the other recursive syntaxes.
|
|
75261
|
+
*/
|
|
75262
|
+
|
|
75263
|
+
if (enforceForLogicalOperands || enforceForInnerExpressions) {
|
|
75264
|
+
if (node.parent.type === "LogicalExpression") {
|
|
75265
|
+
if (node.parent.operator === "||" || node.parent.operator === "&&") {
|
|
75266
|
+
return isInFlaggedContext(node.parent);
|
|
75267
|
+
}
|
|
75215
75268
|
|
|
75216
|
-
|
|
75217
|
-
|
|
75218
|
-
|
|
75269
|
+
// Check the right hand side of a `??` operator.
|
|
75270
|
+
if (enforceForInnerExpressions &&
|
|
75271
|
+
node.parent.operator === "??" &&
|
|
75272
|
+
node.parent.right === node
|
|
75273
|
+
) {
|
|
75274
|
+
return isInFlaggedContext(node.parent);
|
|
75275
|
+
}
|
|
75276
|
+
}
|
|
75277
|
+
}
|
|
75278
|
+
|
|
75279
|
+
if (enforceForInnerExpressions) {
|
|
75280
|
+
if (
|
|
75281
|
+
node.parent.type === "ConditionalExpression" &&
|
|
75282
|
+
(node.parent.consequent === node || node.parent.alternate === node)
|
|
75283
|
+
) {
|
|
75284
|
+
return isInFlaggedContext(node.parent);
|
|
75285
|
+
}
|
|
75286
|
+
|
|
75287
|
+
/*
|
|
75288
|
+
* Check last expression only in a sequence, i.e. if ((1, 2, Boolean(3))) {}, since
|
|
75289
|
+
* the others don't affect the result of the expression.
|
|
75290
|
+
*/
|
|
75291
|
+
if (
|
|
75292
|
+
node.parent.type === "SequenceExpression" &&
|
|
75293
|
+
node.parent.expressions.at(-1) === node
|
|
75294
|
+
) {
|
|
75295
|
+
return isInFlaggedContext(node.parent);
|
|
75296
|
+
}
|
|
75297
|
+
|
|
75298
|
+
}
|
|
75299
|
+
|
|
75300
|
+
return isInBooleanContext(node);
|
|
75219
75301
|
}
|
|
75220
75302
|
|
|
75221
75303
|
|
|
@@ -75242,7 +75324,6 @@
|
|
|
75242
75324
|
* Determines whether the given node needs to be parenthesized when replacing the previous node.
|
|
75243
75325
|
* It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list
|
|
75244
75326
|
* of possible parent node types. By the same assumption, the node's role in a particular parent is already known.
|
|
75245
|
-
* For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child.
|
|
75246
75327
|
* @param {ASTNode} previousNode Previous node.
|
|
75247
75328
|
* @param {ASTNode} node The node to check.
|
|
75248
75329
|
* @throws {Error} (Unreachable.)
|
|
@@ -75252,6 +75333,7 @@
|
|
|
75252
75333
|
if (previousNode.parent.type === "ChainExpression") {
|
|
75253
75334
|
return needsParens(previousNode.parent, node);
|
|
75254
75335
|
}
|
|
75336
|
+
|
|
75255
75337
|
if (isParenthesized(previousNode)) {
|
|
75256
75338
|
|
|
75257
75339
|
// parentheses around the previous node will stay, so there is no need for an additional pair
|
|
@@ -75269,9 +75351,18 @@
|
|
|
75269
75351
|
case "DoWhileStatement":
|
|
75270
75352
|
case "WhileStatement":
|
|
75271
75353
|
case "ForStatement":
|
|
75354
|
+
case "SequenceExpression":
|
|
75272
75355
|
return false;
|
|
75273
75356
|
case "ConditionalExpression":
|
|
75274
|
-
|
|
75357
|
+
if (previousNode === parent.test) {
|
|
75358
|
+
return precedence(node) <= precedence(parent);
|
|
75359
|
+
}
|
|
75360
|
+
if (previousNode === parent.consequent || previousNode === parent.alternate) {
|
|
75361
|
+
return precedence(node) < precedence({ type: "AssignmentExpression" });
|
|
75362
|
+
}
|
|
75363
|
+
|
|
75364
|
+
/* c8 ignore next */
|
|
75365
|
+
throw new Error("Ternary child must be test, consequent, or alternate.");
|
|
75275
75366
|
case "UnaryExpression":
|
|
75276
75367
|
return precedence(node) < precedence(parent);
|
|
75277
75368
|
case "LogicalExpression":
|
|
@@ -81164,12 +81255,10 @@
|
|
|
81164
81255
|
const findCharacterSequences = {
|
|
81165
81256
|
*surrogatePairWithoutUFlag(chars) {
|
|
81166
81257
|
for (const [index, char] of chars.entries()) {
|
|
81167
|
-
if (index === 0) {
|
|
81168
|
-
continue;
|
|
81169
|
-
}
|
|
81170
81258
|
const previous = chars[index - 1];
|
|
81171
81259
|
|
|
81172
81260
|
if (
|
|
81261
|
+
previous && char &&
|
|
81173
81262
|
isSurrogatePair(previous.value, char.value) &&
|
|
81174
81263
|
!isUnicodeCodePointEscape(previous) &&
|
|
81175
81264
|
!isUnicodeCodePointEscape(char)
|
|
@@ -81181,12 +81270,10 @@
|
|
|
81181
81270
|
|
|
81182
81271
|
*surrogatePair(chars) {
|
|
81183
81272
|
for (const [index, char] of chars.entries()) {
|
|
81184
|
-
if (index === 0) {
|
|
81185
|
-
continue;
|
|
81186
|
-
}
|
|
81187
81273
|
const previous = chars[index - 1];
|
|
81188
81274
|
|
|
81189
81275
|
if (
|
|
81276
|
+
previous && char &&
|
|
81190
81277
|
isSurrogatePair(previous.value, char.value) &&
|
|
81191
81278
|
(
|
|
81192
81279
|
isUnicodeCodePointEscape(previous) ||
|
|
@@ -81198,14 +81285,17 @@
|
|
|
81198
81285
|
}
|
|
81199
81286
|
},
|
|
81200
81287
|
|
|
81201
|
-
*combiningClass(chars) {
|
|
81288
|
+
*combiningClass(chars, unfilteredChars) {
|
|
81289
|
+
|
|
81290
|
+
/*
|
|
81291
|
+
* When `allowEscape` is `true`, a combined character should only be allowed if the combining mark appears as an escape sequence.
|
|
81292
|
+
* This means that the base character should be considered even if it's escaped.
|
|
81293
|
+
*/
|
|
81202
81294
|
for (const [index, char] of chars.entries()) {
|
|
81203
|
-
|
|
81204
|
-
continue;
|
|
81205
|
-
}
|
|
81206
|
-
const previous = chars[index - 1];
|
|
81295
|
+
const previous = unfilteredChars[index - 1];
|
|
81207
81296
|
|
|
81208
81297
|
if (
|
|
81298
|
+
previous && char &&
|
|
81209
81299
|
isCombiningCharacter(char.value) &&
|
|
81210
81300
|
!isCombiningCharacter(previous.value)
|
|
81211
81301
|
) {
|
|
@@ -81216,12 +81306,10 @@
|
|
|
81216
81306
|
|
|
81217
81307
|
*emojiModifier(chars) {
|
|
81218
81308
|
for (const [index, char] of chars.entries()) {
|
|
81219
|
-
if (index === 0) {
|
|
81220
|
-
continue;
|
|
81221
|
-
}
|
|
81222
81309
|
const previous = chars[index - 1];
|
|
81223
81310
|
|
|
81224
81311
|
if (
|
|
81312
|
+
previous && char &&
|
|
81225
81313
|
isEmojiModifier(char.value) &&
|
|
81226
81314
|
!isEmojiModifier(previous.value)
|
|
81227
81315
|
) {
|
|
@@ -81232,12 +81320,10 @@
|
|
|
81232
81320
|
|
|
81233
81321
|
*regionalIndicatorSymbol(chars) {
|
|
81234
81322
|
for (const [index, char] of chars.entries()) {
|
|
81235
|
-
if (index === 0) {
|
|
81236
|
-
continue;
|
|
81237
|
-
}
|
|
81238
81323
|
const previous = chars[index - 1];
|
|
81239
81324
|
|
|
81240
81325
|
if (
|
|
81326
|
+
previous && char &&
|
|
81241
81327
|
isRegionalIndicatorSymbol(char.value) &&
|
|
81242
81328
|
isRegionalIndicatorSymbol(previous.value)
|
|
81243
81329
|
) {
|
|
@@ -81250,17 +81336,18 @@
|
|
|
81250
81336
|
let sequence = null;
|
|
81251
81337
|
|
|
81252
81338
|
for (const [index, char] of chars.entries()) {
|
|
81253
|
-
|
|
81254
|
-
|
|
81255
|
-
|
|
81339
|
+
const previous = chars[index - 1];
|
|
81340
|
+
const next = chars[index + 1];
|
|
81341
|
+
|
|
81256
81342
|
if (
|
|
81343
|
+
previous && char && next &&
|
|
81257
81344
|
char.value === 0x200d &&
|
|
81258
|
-
|
|
81259
|
-
|
|
81345
|
+
previous.value !== 0x200d &&
|
|
81346
|
+
next.value !== 0x200d
|
|
81260
81347
|
) {
|
|
81261
81348
|
if (sequence) {
|
|
81262
|
-
if (sequence.at(-1) ===
|
|
81263
|
-
sequence.push(char,
|
|
81349
|
+
if (sequence.at(-1) === previous) {
|
|
81350
|
+
sequence.push(char, next); // append to the sequence
|
|
81264
81351
|
} else {
|
|
81265
81352
|
yield sequence;
|
|
81266
81353
|
sequence = chars.slice(index - 1, index + 2);
|
|
@@ -81306,6 +81393,41 @@
|
|
|
81306
81393
|
return staticValue;
|
|
81307
81394
|
}
|
|
81308
81395
|
|
|
81396
|
+
/**
|
|
81397
|
+
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
|
|
81398
|
+
* This function requires the source text of the character to be known.
|
|
81399
|
+
* @param {Character} char Character to check.
|
|
81400
|
+
* @param {string} charSource Source text of the character to check.
|
|
81401
|
+
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
|
|
81402
|
+
*/
|
|
81403
|
+
function checkForAcceptableEscape(char, charSource) {
|
|
81404
|
+
if (!charSource.startsWith("\\")) {
|
|
81405
|
+
return false;
|
|
81406
|
+
}
|
|
81407
|
+
const match = /(?<=^\\+).$/su.exec(charSource);
|
|
81408
|
+
|
|
81409
|
+
return match?.[0] !== String.fromCodePoint(char.value);
|
|
81410
|
+
}
|
|
81411
|
+
|
|
81412
|
+
/**
|
|
81413
|
+
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
|
|
81414
|
+
* This function works with characters that are produced by a string or template literal.
|
|
81415
|
+
* It requires the source text and the CodeUnit list of the literal to be known.
|
|
81416
|
+
* @param {Character} char Character to check.
|
|
81417
|
+
* @param {string} nodeSource Source text of the string or template literal that produces the character.
|
|
81418
|
+
* @param {CodeUnit[]} codeUnits List of CodeUnit objects of the literal that produces the character.
|
|
81419
|
+
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
|
|
81420
|
+
*/
|
|
81421
|
+
function checkForAcceptableEscapeInString(char, nodeSource, codeUnits) {
|
|
81422
|
+
const firstIndex = char.start;
|
|
81423
|
+
const lastIndex = char.end - 1;
|
|
81424
|
+
const start = codeUnits[firstIndex].start;
|
|
81425
|
+
const end = codeUnits[lastIndex].end;
|
|
81426
|
+
const charSource = nodeSource.slice(start, end);
|
|
81427
|
+
|
|
81428
|
+
return checkForAcceptableEscape(char, charSource);
|
|
81429
|
+
}
|
|
81430
|
+
|
|
81309
81431
|
//------------------------------------------------------------------------------
|
|
81310
81432
|
// Rule Definition
|
|
81311
81433
|
//------------------------------------------------------------------------------
|
|
@@ -81323,7 +81445,18 @@
|
|
|
81323
81445
|
|
|
81324
81446
|
hasSuggestions: true,
|
|
81325
81447
|
|
|
81326
|
-
schema: [
|
|
81448
|
+
schema: [
|
|
81449
|
+
{
|
|
81450
|
+
type: "object",
|
|
81451
|
+
properties: {
|
|
81452
|
+
allowEscape: {
|
|
81453
|
+
type: "boolean",
|
|
81454
|
+
default: false
|
|
81455
|
+
}
|
|
81456
|
+
},
|
|
81457
|
+
additionalProperties: false
|
|
81458
|
+
}
|
|
81459
|
+
],
|
|
81327
81460
|
|
|
81328
81461
|
messages: {
|
|
81329
81462
|
surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.",
|
|
@@ -81336,6 +81469,7 @@
|
|
|
81336
81469
|
}
|
|
81337
81470
|
},
|
|
81338
81471
|
create(context) {
|
|
81472
|
+
const allowEscape = context.options[0]?.allowEscape;
|
|
81339
81473
|
const sourceCode = context.sourceCode;
|
|
81340
81474
|
const parser = new RegExpParser();
|
|
81341
81475
|
const checkedPatternNodes = new Set();
|
|
@@ -81367,24 +81501,62 @@
|
|
|
81367
81501
|
return;
|
|
81368
81502
|
}
|
|
81369
81503
|
|
|
81504
|
+
let codeUnits = null;
|
|
81505
|
+
|
|
81506
|
+
/**
|
|
81507
|
+
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
|
|
81508
|
+
* For the purposes of this rule, an escape sequence is considered acceptable if it consists of one or more backslashes followed by the character being escaped.
|
|
81509
|
+
* @param {Character} char Character to check.
|
|
81510
|
+
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
|
|
81511
|
+
*/
|
|
81512
|
+
function isAcceptableEscapeSequence(char) {
|
|
81513
|
+
if (node.type === "Literal" && node.regex) {
|
|
81514
|
+
return checkForAcceptableEscape(char, char.raw);
|
|
81515
|
+
}
|
|
81516
|
+
if (node.type === "Literal" && typeof node.value === "string") {
|
|
81517
|
+
const nodeSource = node.raw;
|
|
81518
|
+
|
|
81519
|
+
codeUnits ??= parseStringLiteral(nodeSource);
|
|
81520
|
+
|
|
81521
|
+
return checkForAcceptableEscapeInString(char, nodeSource, codeUnits);
|
|
81522
|
+
}
|
|
81523
|
+
if (astUtils.isStaticTemplateLiteral(node)) {
|
|
81524
|
+
const nodeSource = sourceCode.getText(node);
|
|
81525
|
+
|
|
81526
|
+
codeUnits ??= parseTemplateToken(nodeSource);
|
|
81527
|
+
|
|
81528
|
+
return checkForAcceptableEscapeInString(char, nodeSource, codeUnits);
|
|
81529
|
+
}
|
|
81530
|
+
return false;
|
|
81531
|
+
}
|
|
81532
|
+
|
|
81370
81533
|
const foundKindMatches = new Map();
|
|
81371
81534
|
|
|
81372
81535
|
visitRegExpAST(patternNode, {
|
|
81373
81536
|
onCharacterClassEnter(ccNode) {
|
|
81374
|
-
for (const
|
|
81537
|
+
for (const unfilteredChars of iterateCharacterSequence(ccNode.elements)) {
|
|
81538
|
+
let chars;
|
|
81539
|
+
|
|
81540
|
+
if (allowEscape) {
|
|
81541
|
+
|
|
81542
|
+
// Replace escape sequences with null to avoid having them flagged.
|
|
81543
|
+
chars = unfilteredChars.map(char => (isAcceptableEscapeSequence(char) ? null : char));
|
|
81544
|
+
} else {
|
|
81545
|
+
chars = unfilteredChars;
|
|
81546
|
+
}
|
|
81375
81547
|
for (const kind of kinds) {
|
|
81548
|
+
const matches = findCharacterSequences[kind](chars, unfilteredChars);
|
|
81549
|
+
|
|
81376
81550
|
if (foundKindMatches.has(kind)) {
|
|
81377
|
-
foundKindMatches.get(kind).push(...
|
|
81551
|
+
foundKindMatches.get(kind).push(...matches);
|
|
81378
81552
|
} else {
|
|
81379
|
-
foundKindMatches.set(kind, [...
|
|
81553
|
+
foundKindMatches.set(kind, [...matches]);
|
|
81380
81554
|
}
|
|
81381
81555
|
}
|
|
81382
81556
|
}
|
|
81383
81557
|
}
|
|
81384
81558
|
});
|
|
81385
81559
|
|
|
81386
|
-
let codeUnits = null;
|
|
81387
|
-
|
|
81388
81560
|
/**
|
|
81389
81561
|
* Finds the report loc(s) for a range of matches.
|
|
81390
81562
|
* Only literals and expression-less templates generate granular errors.
|
|
@@ -85371,7 +85543,8 @@
|
|
|
85371
85543
|
type: "string"
|
|
85372
85544
|
},
|
|
85373
85545
|
uniqueItems: true
|
|
85374
|
-
}
|
|
85546
|
+
},
|
|
85547
|
+
restrictedNamedExportsPattern: { type: "string" }
|
|
85375
85548
|
},
|
|
85376
85549
|
additionalProperties: false
|
|
85377
85550
|
},
|
|
@@ -85386,6 +85559,7 @@
|
|
|
85386
85559
|
},
|
|
85387
85560
|
uniqueItems: true
|
|
85388
85561
|
},
|
|
85562
|
+
restrictedNamedExportsPattern: { type: "string" },
|
|
85389
85563
|
restrictDefaultExports: {
|
|
85390
85564
|
type: "object",
|
|
85391
85565
|
properties: {
|
|
@@ -85432,6 +85606,7 @@
|
|
|
85432
85606
|
create(context) {
|
|
85433
85607
|
|
|
85434
85608
|
const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports);
|
|
85609
|
+
const restrictedNamePattern = context.options[0] && context.options[0].restrictedNamedExportsPattern;
|
|
85435
85610
|
const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports;
|
|
85436
85611
|
const sourceCode = context.sourceCode;
|
|
85437
85612
|
|
|
@@ -85443,7 +85618,15 @@
|
|
|
85443
85618
|
function checkExportedName(node) {
|
|
85444
85619
|
const name = astUtils.getModuleExportName(node);
|
|
85445
85620
|
|
|
85446
|
-
|
|
85621
|
+
let matchesRestrictedNamePattern = false;
|
|
85622
|
+
|
|
85623
|
+
if (restrictedNamePattern && name !== "default") {
|
|
85624
|
+
const patternRegex = new RegExp(restrictedNamePattern, "u");
|
|
85625
|
+
|
|
85626
|
+
matchesRestrictedNamePattern = patternRegex.test(name);
|
|
85627
|
+
}
|
|
85628
|
+
|
|
85629
|
+
if (matchesRestrictedNamePattern || restrictedNames.has(name)) {
|
|
85447
85630
|
context.report({
|
|
85448
85631
|
node,
|
|
85449
85632
|
messageId: "restrictedNamed",
|
|
@@ -98093,35 +98276,22 @@
|
|
|
98093
98276
|
const arrowToken = sourceCode.getTokenBefore(node.value.body, astUtils.isArrowToken);
|
|
98094
98277
|
const fnBody = sourceCode.text.slice(arrowToken.range[1], node.value.range[1]);
|
|
98095
98278
|
|
|
98096
|
-
|
|
98097
|
-
|
|
98098
|
-
|
|
98099
|
-
|
|
98100
|
-
tokenBeforeParams = sourceCode.getFirstToken(node.value, astUtils.isOpeningParenToken);
|
|
98101
|
-
} else {
|
|
98102
|
-
tokenBeforeParams = sourceCode.getTokenBefore(node.value.params[0]);
|
|
98103
|
-
}
|
|
98104
|
-
|
|
98105
|
-
if (node.value.params.length === 1) {
|
|
98106
|
-
const hasParen = astUtils.isOpeningParenToken(tokenBeforeParams);
|
|
98107
|
-
const isTokenOutsideNode = tokenBeforeParams.range[0] < node.range[0];
|
|
98108
|
-
|
|
98109
|
-
shouldAddParensAroundParameters = !hasParen || isTokenOutsideNode;
|
|
98110
|
-
}
|
|
98279
|
+
// First token should not be `async`
|
|
98280
|
+
const firstValueToken = sourceCode.getFirstToken(node.value, {
|
|
98281
|
+
skip: node.value.async ? 1 : 0
|
|
98282
|
+
});
|
|
98111
98283
|
|
|
98112
|
-
const sliceStart =
|
|
98113
|
-
? node.value.params[0].range[0]
|
|
98114
|
-
: tokenBeforeParams.range[0];
|
|
98284
|
+
const sliceStart = firstValueToken.range[0];
|
|
98115
98285
|
const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1];
|
|
98286
|
+
const shouldAddParens = node.value.params.length === 1 && node.value.params[0].range[0] === sliceStart;
|
|
98116
98287
|
|
|
98117
98288
|
const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd);
|
|
98118
|
-
const newParamText =
|
|
98289
|
+
const newParamText = shouldAddParens ? `(${oldParamText})` : oldParamText;
|
|
98119
98290
|
|
|
98120
98291
|
return fixer.replaceTextRange(
|
|
98121
98292
|
fixRange,
|
|
98122
98293
|
methodPrefix + newParamText + fnBody
|
|
98123
98294
|
);
|
|
98124
|
-
|
|
98125
98295
|
}
|
|
98126
98296
|
|
|
98127
98297
|
/**
|
|
@@ -98306,6 +98476,13 @@
|
|
|
98306
98476
|
node,
|
|
98307
98477
|
messageId: "expectedPropertyShorthand",
|
|
98308
98478
|
fix(fixer) {
|
|
98479
|
+
|
|
98480
|
+
// x: /* */ x
|
|
98481
|
+
// x: (/* */ x)
|
|
98482
|
+
if (sourceCode.getCommentsInside(node).length > 0) {
|
|
98483
|
+
return null;
|
|
98484
|
+
}
|
|
98485
|
+
|
|
98309
98486
|
return fixer.replaceText(node, node.value.name);
|
|
98310
98487
|
}
|
|
98311
98488
|
});
|
|
@@ -98319,6 +98496,13 @@
|
|
|
98319
98496
|
node,
|
|
98320
98497
|
messageId: "expectedPropertyShorthand",
|
|
98321
98498
|
fix(fixer) {
|
|
98499
|
+
|
|
98500
|
+
// "x": /* */ x
|
|
98501
|
+
// "x": (/* */ x)
|
|
98502
|
+
if (sourceCode.getCommentsInside(node).length > 0) {
|
|
98503
|
+
return null;
|
|
98504
|
+
}
|
|
98505
|
+
|
|
98322
98506
|
return fixer.replaceText(node, node.value.name);
|
|
98323
98507
|
}
|
|
98324
98508
|
});
|
|
@@ -112156,7 +112340,7 @@
|
|
|
112156
112340
|
minimatch_1 = minimatch;
|
|
112157
112341
|
minimatch.Minimatch = Minimatch;
|
|
112158
112342
|
|
|
112159
|
-
var path = (function () { try { return require$$0$
|
|
112343
|
+
var path = (function () { try { return require$$0$2 } catch (e) {}}()) || {
|
|
112160
112344
|
sep: '/'
|
|
112161
112345
|
};
|
|
112162
112346
|
minimatch.sep = path.sep;
|
|
@@ -113607,7 +113791,7 @@
|
|
|
113607
113791
|
if (hasRequiredApi) return api;
|
|
113608
113792
|
hasRequiredApi = 1;
|
|
113609
113793
|
|
|
113610
|
-
var path = require$$0$
|
|
113794
|
+
var path = require$$0$2;
|
|
113611
113795
|
var minimatch = requireMinimatch();
|
|
113612
113796
|
var createDebug = requireSrc$1();
|
|
113613
113797
|
var objectSchema = requireSrc();
|
|
@@ -116335,7 +116519,7 @@
|
|
|
116335
116519
|
//------------------------------------------------------------------------------
|
|
116336
116520
|
|
|
116337
116521
|
const
|
|
116338
|
-
path = require$$0$
|
|
116522
|
+
path = require$$0$5,
|
|
116339
116523
|
eslintScope = requireEslintScope(),
|
|
116340
116524
|
evk = requireEslintVisitorKeys$2(),
|
|
116341
116525
|
espree = requireEspree(),
|
|
@@ -117099,7 +117283,7 @@
|
|
|
117099
117283
|
*/
|
|
117100
117284
|
function resolveGlobals(providedGlobals, enabledEnvironments) {
|
|
117101
117285
|
return Object.assign(
|
|
117102
|
-
|
|
117286
|
+
Object.create(null),
|
|
117103
117287
|
...enabledEnvironments.filter(env => env.globals).map(env => env.globals),
|
|
117104
117288
|
providedGlobals
|
|
117105
117289
|
);
|