eslint-linter-browserify 10.0.1 → 10.0.3
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 +661 -196
- package/linter.js +661 -196
- package/linter.min.js +3 -3
- package/linter.mjs +661 -196
- package/package.json +6 -6
package/linter.cjs
CHANGED
|
@@ -4003,7 +4003,7 @@ function requireEslintScope () {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
|
|
4005
4005
|
/** @name module:escope.version */
|
|
4006
|
-
const version = "9.1.
|
|
4006
|
+
const version = "9.1.2"; // x-release-please-version
|
|
4007
4007
|
|
|
4008
4008
|
/* vim: set sw=4 ts=4 et tw=80 : */
|
|
4009
4009
|
|
|
@@ -4216,7 +4216,7 @@ function requireEslintVisitorKeys$2 () {
|
|
|
4216
4216
|
return eslintVisitorKeys$2;
|
|
4217
4217
|
}
|
|
4218
4218
|
|
|
4219
|
-
var version = "10.0.
|
|
4219
|
+
var version = "10.0.3";
|
|
4220
4220
|
var require$$3$1 = {
|
|
4221
4221
|
version: version};
|
|
4222
4222
|
|
|
@@ -22788,7 +22788,7 @@ function requireCommonjs$1 () {
|
|
|
22788
22788
|
const openPattern = /\\{/g;
|
|
22789
22789
|
const closePattern = /\\}/g;
|
|
22790
22790
|
const commaPattern = /\\,/g;
|
|
22791
|
-
const periodPattern =
|
|
22791
|
+
const periodPattern = /\\\./g;
|
|
22792
22792
|
exports$1.EXPANSION_MAX = 100_000;
|
|
22793
22793
|
function numeric(str) {
|
|
22794
22794
|
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
@@ -23208,12 +23208,114 @@ function requireAst$1 () {
|
|
|
23208
23208
|
if (hasRequiredAst$1) return ast$1;
|
|
23209
23209
|
hasRequiredAst$1 = 1;
|
|
23210
23210
|
// parse a single path portion
|
|
23211
|
+
var _a;
|
|
23211
23212
|
Object.defineProperty(ast$1, "__esModule", { value: true });
|
|
23212
23213
|
ast$1.AST = void 0;
|
|
23213
23214
|
const brace_expressions_js_1 = requireBraceExpressions();
|
|
23214
23215
|
const unescape_js_1 = require_unescape();
|
|
23215
23216
|
const types = new Set(['!', '?', '+', '*', '@']);
|
|
23216
23217
|
const isExtglobType = (c) => types.has(c);
|
|
23218
|
+
const isExtglobAST = (c) => isExtglobType(c.type);
|
|
23219
|
+
// Map of which extglob types can adopt the children of a nested extglob
|
|
23220
|
+
//
|
|
23221
|
+
// anything but ! can adopt a matching type:
|
|
23222
|
+
// +(a|+(b|c)|d) => +(a|b|c|d)
|
|
23223
|
+
// *(a|*(b|c)|d) => *(a|b|c|d)
|
|
23224
|
+
// @(a|@(b|c)|d) => @(a|b|c|d)
|
|
23225
|
+
// ?(a|?(b|c)|d) => ?(a|b|c|d)
|
|
23226
|
+
//
|
|
23227
|
+
// * can adopt anything, because 0 or repetition is allowed
|
|
23228
|
+
// *(a|?(b|c)|d) => *(a|b|c|d)
|
|
23229
|
+
// *(a|+(b|c)|d) => *(a|b|c|d)
|
|
23230
|
+
// *(a|@(b|c)|d) => *(a|b|c|d)
|
|
23231
|
+
//
|
|
23232
|
+
// + can adopt @, because 1 or repetition is allowed
|
|
23233
|
+
// +(a|@(b|c)|d) => +(a|b|c|d)
|
|
23234
|
+
//
|
|
23235
|
+
// + and @ CANNOT adopt *, because 0 would be allowed
|
|
23236
|
+
// +(a|*(b|c)|d) => would match "", on *(b|c)
|
|
23237
|
+
// @(a|*(b|c)|d) => would match "", on *(b|c)
|
|
23238
|
+
//
|
|
23239
|
+
// + and @ CANNOT adopt ?, because 0 would be allowed
|
|
23240
|
+
// +(a|?(b|c)|d) => would match "", on ?(b|c)
|
|
23241
|
+
// @(a|?(b|c)|d) => would match "", on ?(b|c)
|
|
23242
|
+
//
|
|
23243
|
+
// ? can adopt @, because 0 or 1 is allowed
|
|
23244
|
+
// ?(a|@(b|c)|d) => ?(a|b|c|d)
|
|
23245
|
+
//
|
|
23246
|
+
// ? and @ CANNOT adopt * or +, because >1 would be allowed
|
|
23247
|
+
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
|
|
23248
|
+
// @(a|*(b|c)|d) => would match bbb on *(b|c)
|
|
23249
|
+
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
|
|
23250
|
+
// @(a|+(b|c)|d) => would match bbb on +(b|c)
|
|
23251
|
+
//
|
|
23252
|
+
// ! CANNOT adopt ! (nothing else can either)
|
|
23253
|
+
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
|
|
23254
|
+
//
|
|
23255
|
+
// ! can adopt @
|
|
23256
|
+
// !(a|@(b|c)|d) => !(a|b|c|d)
|
|
23257
|
+
//
|
|
23258
|
+
// ! CANNOT adopt *
|
|
23259
|
+
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
|
23260
|
+
//
|
|
23261
|
+
// ! CANNOT adopt +
|
|
23262
|
+
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
|
23263
|
+
//
|
|
23264
|
+
// ! CANNOT adopt ?
|
|
23265
|
+
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
|
|
23266
|
+
const adoptionMap = new Map([
|
|
23267
|
+
['!', ['@']],
|
|
23268
|
+
['?', ['?', '@']],
|
|
23269
|
+
['@', ['@']],
|
|
23270
|
+
['*', ['*', '+', '?', '@']],
|
|
23271
|
+
['+', ['+', '@']],
|
|
23272
|
+
]);
|
|
23273
|
+
// nested extglobs that can be adopted in, but with the addition of
|
|
23274
|
+
// a blank '' element.
|
|
23275
|
+
const adoptionWithSpaceMap = new Map([
|
|
23276
|
+
['!', ['?']],
|
|
23277
|
+
['@', ['?']],
|
|
23278
|
+
['+', ['?', '*']],
|
|
23279
|
+
]);
|
|
23280
|
+
// union of the previous two maps
|
|
23281
|
+
const adoptionAnyMap = new Map([
|
|
23282
|
+
['!', ['?', '@']],
|
|
23283
|
+
['?', ['?', '@']],
|
|
23284
|
+
['@', ['?', '@']],
|
|
23285
|
+
['*', ['*', '+', '?', '@']],
|
|
23286
|
+
['+', ['+', '@', '?', '*']],
|
|
23287
|
+
]);
|
|
23288
|
+
// Extglobs that can take over their parent if they are the only child
|
|
23289
|
+
// the key is parent, value maps child to resulting extglob parent type
|
|
23290
|
+
// '@' is omitted because it's a special case. An `@` extglob with a single
|
|
23291
|
+
// member can always be usurped by that subpattern.
|
|
23292
|
+
const usurpMap = new Map([
|
|
23293
|
+
['!', new Map([['!', '@']])],
|
|
23294
|
+
[
|
|
23295
|
+
'?',
|
|
23296
|
+
new Map([
|
|
23297
|
+
['*', '*'],
|
|
23298
|
+
['+', '*'],
|
|
23299
|
+
]),
|
|
23300
|
+
],
|
|
23301
|
+
[
|
|
23302
|
+
'@',
|
|
23303
|
+
new Map([
|
|
23304
|
+
['!', '!'],
|
|
23305
|
+
['?', '?'],
|
|
23306
|
+
['@', '@'],
|
|
23307
|
+
['*', '*'],
|
|
23308
|
+
['+', '+'],
|
|
23309
|
+
]),
|
|
23310
|
+
],
|
|
23311
|
+
[
|
|
23312
|
+
'+',
|
|
23313
|
+
new Map([
|
|
23314
|
+
['?', '*'],
|
|
23315
|
+
['*', '*'],
|
|
23316
|
+
]),
|
|
23317
|
+
],
|
|
23318
|
+
]);
|
|
23217
23319
|
// Patterns that get prepended to bind to the start of either the
|
|
23218
23320
|
// entire string, or just a single path portion, to prevent dots
|
|
23219
23321
|
// and/or traversal patterns, when needed.
|
|
@@ -23237,6 +23339,7 @@ function requireAst$1 () {
|
|
|
23237
23339
|
const starNoEmpty = qmark + '+?';
|
|
23238
23340
|
// remove the \ chars that we added if we end up doing a nonmagic compare
|
|
23239
23341
|
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
|
|
23342
|
+
let ID = 0;
|
|
23240
23343
|
class AST {
|
|
23241
23344
|
type;
|
|
23242
23345
|
#root;
|
|
@@ -23252,6 +23355,22 @@ function requireAst$1 () {
|
|
|
23252
23355
|
// set to true if it's an extglob with no children
|
|
23253
23356
|
// (which really means one child of '')
|
|
23254
23357
|
#emptyExt = false;
|
|
23358
|
+
id = ++ID;
|
|
23359
|
+
get depth() {
|
|
23360
|
+
return (this.#parent?.depth ?? -1) + 1;
|
|
23361
|
+
}
|
|
23362
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
23363
|
+
return {
|
|
23364
|
+
'@@type': 'AST',
|
|
23365
|
+
id: this.id,
|
|
23366
|
+
type: this.type,
|
|
23367
|
+
root: this.#root.id,
|
|
23368
|
+
parent: this.#parent?.id,
|
|
23369
|
+
depth: this.depth,
|
|
23370
|
+
partsLength: this.#parts.length,
|
|
23371
|
+
parts: this.#parts,
|
|
23372
|
+
};
|
|
23373
|
+
}
|
|
23255
23374
|
constructor(type, parent, options = {}) {
|
|
23256
23375
|
this.type = type;
|
|
23257
23376
|
// extglobs are inherently magical
|
|
@@ -23331,7 +23450,7 @@ function requireAst$1 () {
|
|
|
23331
23450
|
continue;
|
|
23332
23451
|
/* c8 ignore start */
|
|
23333
23452
|
if (typeof p !== 'string' &&
|
|
23334
|
-
!(p instanceof
|
|
23453
|
+
!(p instanceof _a && p.#parent === this)) {
|
|
23335
23454
|
throw new Error('invalid part: ' + p);
|
|
23336
23455
|
}
|
|
23337
23456
|
/* c8 ignore stop */
|
|
@@ -23365,7 +23484,7 @@ function requireAst$1 () {
|
|
|
23365
23484
|
const p = this.#parent;
|
|
23366
23485
|
for (let i = 0; i < this.#parentIndex; i++) {
|
|
23367
23486
|
const pp = p.#parts[i];
|
|
23368
|
-
if (!(pp instanceof
|
|
23487
|
+
if (!(pp instanceof _a && pp.type === '!')) {
|
|
23369
23488
|
return false;
|
|
23370
23489
|
}
|
|
23371
23490
|
}
|
|
@@ -23393,13 +23512,14 @@ function requireAst$1 () {
|
|
|
23393
23512
|
this.push(part.clone(this));
|
|
23394
23513
|
}
|
|
23395
23514
|
clone(parent) {
|
|
23396
|
-
const c = new
|
|
23515
|
+
const c = new _a(this.type, parent);
|
|
23397
23516
|
for (const p of this.#parts) {
|
|
23398
23517
|
c.copyIn(p);
|
|
23399
23518
|
}
|
|
23400
23519
|
return c;
|
|
23401
23520
|
}
|
|
23402
|
-
static #parseAST(str, ast, pos, opt) {
|
|
23521
|
+
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
23522
|
+
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
23403
23523
|
let escaping = false;
|
|
23404
23524
|
let inBrace = false;
|
|
23405
23525
|
let braceStart = -1;
|
|
@@ -23436,11 +23556,17 @@ function requireAst$1 () {
|
|
|
23436
23556
|
acc += c;
|
|
23437
23557
|
continue;
|
|
23438
23558
|
}
|
|
23439
|
-
|
|
23559
|
+
// we don't have to check for adoption here, because that's
|
|
23560
|
+
// done at the other recursion point.
|
|
23561
|
+
const doRecurse = !opt.noext &&
|
|
23562
|
+
isExtglobType(c) &&
|
|
23563
|
+
str.charAt(i) === '(' &&
|
|
23564
|
+
extDepth <= maxDepth;
|
|
23565
|
+
if (doRecurse) {
|
|
23440
23566
|
ast.push(acc);
|
|
23441
23567
|
acc = '';
|
|
23442
|
-
const ext = new
|
|
23443
|
-
i =
|
|
23568
|
+
const ext = new _a(c, ast);
|
|
23569
|
+
i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
|
|
23444
23570
|
ast.push(ext);
|
|
23445
23571
|
continue;
|
|
23446
23572
|
}
|
|
@@ -23452,7 +23578,7 @@ function requireAst$1 () {
|
|
|
23452
23578
|
// some kind of extglob, pos is at the (
|
|
23453
23579
|
// find the next | or )
|
|
23454
23580
|
let i = pos + 1;
|
|
23455
|
-
let part = new
|
|
23581
|
+
let part = new _a(null, ast);
|
|
23456
23582
|
const parts = [];
|
|
23457
23583
|
let acc = '';
|
|
23458
23584
|
while (i < str.length) {
|
|
@@ -23483,19 +23609,26 @@ function requireAst$1 () {
|
|
|
23483
23609
|
acc += c;
|
|
23484
23610
|
continue;
|
|
23485
23611
|
}
|
|
23486
|
-
|
|
23612
|
+
const doRecurse = !opt.noext &&
|
|
23613
|
+
isExtglobType(c) &&
|
|
23614
|
+
str.charAt(i) === '(' &&
|
|
23615
|
+
/* c8 ignore start - the maxDepth is sufficient here */
|
|
23616
|
+
(extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
|
|
23617
|
+
/* c8 ignore stop */
|
|
23618
|
+
if (doRecurse) {
|
|
23619
|
+
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
23487
23620
|
part.push(acc);
|
|
23488
23621
|
acc = '';
|
|
23489
|
-
const ext = new
|
|
23622
|
+
const ext = new _a(c, part);
|
|
23490
23623
|
part.push(ext);
|
|
23491
|
-
i =
|
|
23624
|
+
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
|
23492
23625
|
continue;
|
|
23493
23626
|
}
|
|
23494
23627
|
if (c === '|') {
|
|
23495
23628
|
part.push(acc);
|
|
23496
23629
|
acc = '';
|
|
23497
23630
|
parts.push(part);
|
|
23498
|
-
part = new
|
|
23631
|
+
part = new _a(null, ast);
|
|
23499
23632
|
continue;
|
|
23500
23633
|
}
|
|
23501
23634
|
if (c === ')') {
|
|
@@ -23517,9 +23650,82 @@ function requireAst$1 () {
|
|
|
23517
23650
|
ast.#parts = [str.substring(pos - 1)];
|
|
23518
23651
|
return i;
|
|
23519
23652
|
}
|
|
23653
|
+
#canAdoptWithSpace(child) {
|
|
23654
|
+
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
23655
|
+
}
|
|
23656
|
+
#canAdopt(child, map = adoptionMap) {
|
|
23657
|
+
if (!child ||
|
|
23658
|
+
typeof child !== 'object' ||
|
|
23659
|
+
child.type !== null ||
|
|
23660
|
+
child.#parts.length !== 1 ||
|
|
23661
|
+
this.type === null) {
|
|
23662
|
+
return false;
|
|
23663
|
+
}
|
|
23664
|
+
const gc = child.#parts[0];
|
|
23665
|
+
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
|
23666
|
+
return false;
|
|
23667
|
+
}
|
|
23668
|
+
return this.#canAdoptType(gc.type, map);
|
|
23669
|
+
}
|
|
23670
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
23671
|
+
return !!map.get(this.type)?.includes(c);
|
|
23672
|
+
}
|
|
23673
|
+
#adoptWithSpace(child, index) {
|
|
23674
|
+
const gc = child.#parts[0];
|
|
23675
|
+
const blank = new _a(null, gc, this.options);
|
|
23676
|
+
blank.#parts.push('');
|
|
23677
|
+
gc.push(blank);
|
|
23678
|
+
this.#adopt(child, index);
|
|
23679
|
+
}
|
|
23680
|
+
#adopt(child, index) {
|
|
23681
|
+
const gc = child.#parts[0];
|
|
23682
|
+
this.#parts.splice(index, 1, ...gc.#parts);
|
|
23683
|
+
for (const p of gc.#parts) {
|
|
23684
|
+
if (typeof p === 'object')
|
|
23685
|
+
p.#parent = this;
|
|
23686
|
+
}
|
|
23687
|
+
this.#toString = undefined;
|
|
23688
|
+
}
|
|
23689
|
+
#canUsurpType(c) {
|
|
23690
|
+
const m = usurpMap.get(this.type);
|
|
23691
|
+
return !!(m?.has(c));
|
|
23692
|
+
}
|
|
23693
|
+
#canUsurp(child) {
|
|
23694
|
+
if (!child ||
|
|
23695
|
+
typeof child !== 'object' ||
|
|
23696
|
+
child.type !== null ||
|
|
23697
|
+
child.#parts.length !== 1 ||
|
|
23698
|
+
this.type === null ||
|
|
23699
|
+
this.#parts.length !== 1) {
|
|
23700
|
+
return false;
|
|
23701
|
+
}
|
|
23702
|
+
const gc = child.#parts[0];
|
|
23703
|
+
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
|
23704
|
+
return false;
|
|
23705
|
+
}
|
|
23706
|
+
return this.#canUsurpType(gc.type);
|
|
23707
|
+
}
|
|
23708
|
+
#usurp(child) {
|
|
23709
|
+
const m = usurpMap.get(this.type);
|
|
23710
|
+
const gc = child.#parts[0];
|
|
23711
|
+
const nt = m?.get(gc.type);
|
|
23712
|
+
/* c8 ignore start - impossible */
|
|
23713
|
+
if (!nt)
|
|
23714
|
+
return false;
|
|
23715
|
+
/* c8 ignore stop */
|
|
23716
|
+
this.#parts = gc.#parts;
|
|
23717
|
+
for (const p of this.#parts) {
|
|
23718
|
+
if (typeof p === 'object') {
|
|
23719
|
+
p.#parent = this;
|
|
23720
|
+
}
|
|
23721
|
+
}
|
|
23722
|
+
this.type = nt;
|
|
23723
|
+
this.#toString = undefined;
|
|
23724
|
+
this.#emptyExt = false;
|
|
23725
|
+
}
|
|
23520
23726
|
static fromGlob(pattern, options = {}) {
|
|
23521
|
-
const ast = new
|
|
23522
|
-
|
|
23727
|
+
const ast = new _a(null, undefined, options);
|
|
23728
|
+
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
23523
23729
|
return ast;
|
|
23524
23730
|
}
|
|
23525
23731
|
// returns the regular expression if there's magic, or the unescaped
|
|
@@ -23623,16 +23829,18 @@ function requireAst$1 () {
|
|
|
23623
23829
|
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
23624
23830
|
toRegExpSource(allowDot) {
|
|
23625
23831
|
const dot = allowDot ?? !!this.#options.dot;
|
|
23626
|
-
if (this.#root === this)
|
|
23832
|
+
if (this.#root === this) {
|
|
23833
|
+
this.#flatten();
|
|
23627
23834
|
this.#fillNegs();
|
|
23628
|
-
|
|
23835
|
+
}
|
|
23836
|
+
if (!isExtglobAST(this)) {
|
|
23629
23837
|
const noEmpty = this.isStart() &&
|
|
23630
23838
|
this.isEnd() &&
|
|
23631
23839
|
!this.#parts.some(s => typeof s !== 'string');
|
|
23632
23840
|
const src = this.#parts
|
|
23633
23841
|
.map(p => {
|
|
23634
23842
|
const [re, _, hasMagic, uflag] = typeof p === 'string' ?
|
|
23635
|
-
|
|
23843
|
+
_a.#parseGlob(p, this.#hasMagic, noEmpty)
|
|
23636
23844
|
: p.toRegExpSource(allowDot);
|
|
23637
23845
|
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
23638
23846
|
this.#uflag = this.#uflag || uflag;
|
|
@@ -23694,12 +23902,12 @@ function requireAst$1 () {
|
|
|
23694
23902
|
// invalid extglob, has to at least be *something* present, if it's
|
|
23695
23903
|
// the entire path portion.
|
|
23696
23904
|
const s = this.toString();
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23905
|
+
const me = this;
|
|
23906
|
+
me.#parts = [s];
|
|
23907
|
+
me.type = null;
|
|
23908
|
+
me.#hasMagic = undefined;
|
|
23700
23909
|
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
|
23701
23910
|
}
|
|
23702
|
-
// XXX abstract out this map method
|
|
23703
23911
|
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
|
|
23704
23912
|
''
|
|
23705
23913
|
: this.#partsToRegExp(true);
|
|
@@ -23735,6 +23943,42 @@ function requireAst$1 () {
|
|
|
23735
23943
|
this.#uflag,
|
|
23736
23944
|
];
|
|
23737
23945
|
}
|
|
23946
|
+
#flatten() {
|
|
23947
|
+
if (!isExtglobAST(this)) {
|
|
23948
|
+
for (const p of this.#parts) {
|
|
23949
|
+
if (typeof p === 'object') {
|
|
23950
|
+
p.#flatten();
|
|
23951
|
+
}
|
|
23952
|
+
}
|
|
23953
|
+
}
|
|
23954
|
+
else {
|
|
23955
|
+
// do up to 10 passes to flatten as much as possible
|
|
23956
|
+
let iterations = 0;
|
|
23957
|
+
let done = false;
|
|
23958
|
+
do {
|
|
23959
|
+
done = true;
|
|
23960
|
+
for (let i = 0; i < this.#parts.length; i++) {
|
|
23961
|
+
const c = this.#parts[i];
|
|
23962
|
+
if (typeof c === 'object') {
|
|
23963
|
+
c.#flatten();
|
|
23964
|
+
if (this.#canAdopt(c)) {
|
|
23965
|
+
done = false;
|
|
23966
|
+
this.#adopt(c, i);
|
|
23967
|
+
}
|
|
23968
|
+
else if (this.#canAdoptWithSpace(c)) {
|
|
23969
|
+
done = false;
|
|
23970
|
+
this.#adoptWithSpace(c, i);
|
|
23971
|
+
}
|
|
23972
|
+
else if (this.#canUsurp(c)) {
|
|
23973
|
+
done = false;
|
|
23974
|
+
this.#usurp(c);
|
|
23975
|
+
}
|
|
23976
|
+
}
|
|
23977
|
+
}
|
|
23978
|
+
} while (!done && ++iterations < 10);
|
|
23979
|
+
}
|
|
23980
|
+
this.#toString = undefined;
|
|
23981
|
+
}
|
|
23738
23982
|
#partsToRegExp(dot) {
|
|
23739
23983
|
return this.#parts
|
|
23740
23984
|
.map(p => {
|
|
@@ -23806,6 +24050,7 @@ function requireAst$1 () {
|
|
|
23806
24050
|
}
|
|
23807
24051
|
}
|
|
23808
24052
|
ast$1.AST = AST;
|
|
24053
|
+
_a = AST;
|
|
23809
24054
|
|
|
23810
24055
|
return ast$1;
|
|
23811
24056
|
}
|
|
@@ -24058,11 +24303,13 @@ function requireCommonjs () {
|
|
|
24058
24303
|
isWindows;
|
|
24059
24304
|
platform;
|
|
24060
24305
|
windowsNoMagicRoot;
|
|
24306
|
+
maxGlobstarRecursion;
|
|
24061
24307
|
regexp;
|
|
24062
24308
|
constructor(pattern, options = {}) {
|
|
24063
24309
|
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
|
24064
24310
|
options = options || {};
|
|
24065
24311
|
this.options = options;
|
|
24312
|
+
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
|
24066
24313
|
this.pattern = pattern;
|
|
24067
24314
|
this.platform = options.platform || defaultPlatform;
|
|
24068
24315
|
this.isWindows = this.platform === 'win32';
|
|
@@ -24467,7 +24714,8 @@ function requireCommonjs () {
|
|
|
24467
24714
|
// out of pattern, then that's fine, as long as all
|
|
24468
24715
|
// the parts match.
|
|
24469
24716
|
matchOne(file, pattern, partial = false) {
|
|
24470
|
-
|
|
24717
|
+
let fileStartIndex = 0;
|
|
24718
|
+
let patternStartIndex = 0;
|
|
24471
24719
|
// UNC paths like //?/X:/... can match X:/... and vice versa
|
|
24472
24720
|
// Drive letters in absolute drive or unc paths are always compared
|
|
24473
24721
|
// case-insensitively.
|
|
@@ -24496,14 +24744,11 @@ function requireCommonjs () {
|
|
|
24496
24744
|
file[fdi],
|
|
24497
24745
|
pattern[pdi],
|
|
24498
24746
|
];
|
|
24747
|
+
// start matching at the drive letter index of each
|
|
24499
24748
|
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
24500
24749
|
pattern[pdi] = fd;
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
}
|
|
24504
|
-
else if (fdi > pdi) {
|
|
24505
|
-
file = file.slice(fdi);
|
|
24506
|
-
}
|
|
24750
|
+
patternStartIndex = pdi;
|
|
24751
|
+
fileStartIndex = fdi;
|
|
24507
24752
|
}
|
|
24508
24753
|
}
|
|
24509
24754
|
}
|
|
@@ -24513,99 +24758,185 @@ function requireCommonjs () {
|
|
|
24513
24758
|
if (optimizationLevel >= 2) {
|
|
24514
24759
|
file = this.levelTwoFileOptimize(file);
|
|
24515
24760
|
}
|
|
24516
|
-
|
|
24517
|
-
|
|
24518
|
-
|
|
24761
|
+
if (pattern.includes(exports$1.GLOBSTAR)) {
|
|
24762
|
+
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
24763
|
+
}
|
|
24764
|
+
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
24765
|
+
}
|
|
24766
|
+
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
|
24767
|
+
// split the pattern into head, tail, and middle of ** delimited parts
|
|
24768
|
+
const firstgs = pattern.indexOf(exports$1.GLOBSTAR, patternIndex);
|
|
24769
|
+
const lastgs = pattern.lastIndexOf(exports$1.GLOBSTAR);
|
|
24770
|
+
// split the pattern up into globstar-delimited sections
|
|
24771
|
+
// the tail has to be at the end, and the others just have
|
|
24772
|
+
// to be found in order from the head.
|
|
24773
|
+
const [head, body, tail] = partial ? [
|
|
24774
|
+
pattern.slice(patternIndex, firstgs),
|
|
24775
|
+
pattern.slice(firstgs + 1),
|
|
24776
|
+
[],
|
|
24777
|
+
] : [
|
|
24778
|
+
pattern.slice(patternIndex, firstgs),
|
|
24779
|
+
pattern.slice(firstgs + 1, lastgs),
|
|
24780
|
+
pattern.slice(lastgs + 1),
|
|
24781
|
+
];
|
|
24782
|
+
// check the head, from the current file/pattern index.
|
|
24783
|
+
if (head.length) {
|
|
24784
|
+
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
24785
|
+
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
|
24786
|
+
return false;
|
|
24787
|
+
}
|
|
24788
|
+
fileIndex += head.length;
|
|
24789
|
+
patternIndex += head.length;
|
|
24790
|
+
}
|
|
24791
|
+
// now we know the head matches!
|
|
24792
|
+
// if the last portion is not empty, it MUST match the end
|
|
24793
|
+
// check the tail
|
|
24794
|
+
let fileTailMatch = 0;
|
|
24795
|
+
if (tail.length) {
|
|
24796
|
+
// if head + tail > file, then we cannot possibly match
|
|
24797
|
+
if (tail.length + fileIndex > file.length)
|
|
24798
|
+
return false;
|
|
24799
|
+
// try to match the tail
|
|
24800
|
+
let tailStart = file.length - tail.length;
|
|
24801
|
+
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
24802
|
+
fileTailMatch = tail.length;
|
|
24803
|
+
}
|
|
24804
|
+
else {
|
|
24805
|
+
// affordance for stuff like a/**/* matching a/b/
|
|
24806
|
+
// if the last file portion is '', and there's more to the pattern
|
|
24807
|
+
// then try without the '' bit.
|
|
24808
|
+
if (file[file.length - 1] !== '' ||
|
|
24809
|
+
fileIndex + tail.length === file.length) {
|
|
24810
|
+
return false;
|
|
24811
|
+
}
|
|
24812
|
+
tailStart--;
|
|
24813
|
+
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
24814
|
+
return false;
|
|
24815
|
+
}
|
|
24816
|
+
fileTailMatch = tail.length + 1;
|
|
24817
|
+
}
|
|
24818
|
+
}
|
|
24819
|
+
// now we know the tail matches!
|
|
24820
|
+
// the middle is zero or more portions wrapped in **, possibly
|
|
24821
|
+
// containing more ** sections.
|
|
24822
|
+
// so a/**/b/**/c/**/d has become **/b/**/c/**
|
|
24823
|
+
// if it's empty, it means a/**/b, just verify we have no bad dots
|
|
24824
|
+
// if there's no tail, so it ends on /**, then we must have *something*
|
|
24825
|
+
// after the head, or it's not a matc
|
|
24826
|
+
if (!body.length) {
|
|
24827
|
+
let sawSome = !!fileTailMatch;
|
|
24828
|
+
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
|
24829
|
+
const f = String(file[i]);
|
|
24830
|
+
sawSome = true;
|
|
24831
|
+
if (f === '.' ||
|
|
24832
|
+
f === '..' ||
|
|
24833
|
+
(!this.options.dot && f.startsWith('.'))) {
|
|
24834
|
+
return false;
|
|
24835
|
+
}
|
|
24836
|
+
}
|
|
24837
|
+
// in partial mode, we just need to get past all file parts
|
|
24838
|
+
return partial || sawSome;
|
|
24839
|
+
}
|
|
24840
|
+
// now we know that there's one or more body sections, which can
|
|
24841
|
+
// be matched anywhere from the 0 index (because the head was pruned)
|
|
24842
|
+
// through to the length-fileTailMatch index.
|
|
24843
|
+
// split the body up into sections, and note the minimum index it can
|
|
24844
|
+
// be found at (start with the length of all previous segments)
|
|
24845
|
+
// [section, before, after]
|
|
24846
|
+
const bodySegments = [[[], 0]];
|
|
24847
|
+
let currentBody = bodySegments[0];
|
|
24848
|
+
let nonGsParts = 0;
|
|
24849
|
+
const nonGsPartsSums = [0];
|
|
24850
|
+
for (const b of body) {
|
|
24851
|
+
if (b === exports$1.GLOBSTAR) {
|
|
24852
|
+
nonGsPartsSums.push(nonGsParts);
|
|
24853
|
+
currentBody = [[], 0];
|
|
24854
|
+
bodySegments.push(currentBody);
|
|
24855
|
+
}
|
|
24856
|
+
else {
|
|
24857
|
+
currentBody[0].push(b);
|
|
24858
|
+
nonGsParts++;
|
|
24859
|
+
}
|
|
24860
|
+
}
|
|
24861
|
+
let i = bodySegments.length - 1;
|
|
24862
|
+
const fileLength = file.length - fileTailMatch;
|
|
24863
|
+
for (const b of bodySegments) {
|
|
24864
|
+
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
24865
|
+
}
|
|
24866
|
+
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
24867
|
+
}
|
|
24868
|
+
// return false for "nope, not matching"
|
|
24869
|
+
// return null for "not matching, cannot keep trying"
|
|
24870
|
+
#matchGlobStarBodySections(file,
|
|
24871
|
+
// pattern section, last possible position for it
|
|
24872
|
+
bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
24873
|
+
// take the first body segment, and walk from fileIndex to its "after"
|
|
24874
|
+
// value at the end
|
|
24875
|
+
// If it doesn't match at that position, we increment, until we hit
|
|
24876
|
+
// that final possible position, and give up.
|
|
24877
|
+
// If it does match, then advance and try to rest.
|
|
24878
|
+
// If any of them fail we keep walking forward.
|
|
24879
|
+
// this is still a bit recursively painful, but it's more constrained
|
|
24880
|
+
// than previous implementations, because we never test something that
|
|
24881
|
+
// can't possibly be a valid matching condition.
|
|
24882
|
+
const bs = bodySegments[bodyIndex];
|
|
24883
|
+
if (!bs) {
|
|
24884
|
+
// just make sure that there's no bad dots
|
|
24885
|
+
for (let i = fileIndex; i < file.length; i++) {
|
|
24886
|
+
sawTail = true;
|
|
24887
|
+
const f = file[i];
|
|
24888
|
+
if (f === '.' ||
|
|
24889
|
+
f === '..' ||
|
|
24890
|
+
(!this.options.dot && f.startsWith('.'))) {
|
|
24891
|
+
return false;
|
|
24892
|
+
}
|
|
24893
|
+
}
|
|
24894
|
+
return sawTail;
|
|
24895
|
+
}
|
|
24896
|
+
// have a non-globstar body section to test
|
|
24897
|
+
const [body, after] = bs;
|
|
24898
|
+
while (fileIndex <= after) {
|
|
24899
|
+
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
|
24900
|
+
// if limit exceeded, no match. intentional false negative,
|
|
24901
|
+
// acceptable break in correctness for security.
|
|
24902
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
24903
|
+
// match! see if the rest match. if so, we're done!
|
|
24904
|
+
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
24905
|
+
if (sub !== false) {
|
|
24906
|
+
return sub;
|
|
24907
|
+
}
|
|
24908
|
+
}
|
|
24909
|
+
const f = file[fileIndex];
|
|
24910
|
+
if (f === '.' ||
|
|
24911
|
+
f === '..' ||
|
|
24912
|
+
(!this.options.dot && f.startsWith('.'))) {
|
|
24913
|
+
return false;
|
|
24914
|
+
}
|
|
24915
|
+
fileIndex++;
|
|
24916
|
+
}
|
|
24917
|
+
// walked off. no point continuing
|
|
24918
|
+
return partial || null;
|
|
24919
|
+
}
|
|
24920
|
+
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
|
24921
|
+
let fi;
|
|
24922
|
+
let pi;
|
|
24923
|
+
let pl;
|
|
24924
|
+
let fl;
|
|
24925
|
+
for (fi = fileIndex,
|
|
24926
|
+
pi = patternIndex,
|
|
24927
|
+
fl = file.length,
|
|
24928
|
+
pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
24519
24929
|
this.debug('matchOne loop');
|
|
24520
|
-
|
|
24521
|
-
|
|
24930
|
+
let p = pattern[pi];
|
|
24931
|
+
let f = file[fi];
|
|
24522
24932
|
this.debug(pattern, p, f);
|
|
24523
24933
|
// should be impossible.
|
|
24524
24934
|
// some invalid regexp stuff in the set.
|
|
24525
24935
|
/* c8 ignore start */
|
|
24526
|
-
if (p === false) {
|
|
24936
|
+
if (p === false || p === exports$1.GLOBSTAR) {
|
|
24527
24937
|
return false;
|
|
24528
24938
|
}
|
|
24529
24939
|
/* c8 ignore stop */
|
|
24530
|
-
if (p === exports$1.GLOBSTAR) {
|
|
24531
|
-
this.debug('GLOBSTAR', [pattern, p, f]);
|
|
24532
|
-
// "**"
|
|
24533
|
-
// a/**/b/**/c would match the following:
|
|
24534
|
-
// a/b/x/y/z/c
|
|
24535
|
-
// a/x/y/z/b/c
|
|
24536
|
-
// a/b/x/b/x/c
|
|
24537
|
-
// a/b/c
|
|
24538
|
-
// To do this, take the rest of the pattern after
|
|
24539
|
-
// the **, and see if it would match the file remainder.
|
|
24540
|
-
// If so, return success.
|
|
24541
|
-
// If not, the ** "swallows" a segment, and try again.
|
|
24542
|
-
// This is recursively awful.
|
|
24543
|
-
//
|
|
24544
|
-
// a/**/b/**/c matching a/b/x/y/z/c
|
|
24545
|
-
// - a matches a
|
|
24546
|
-
// - doublestar
|
|
24547
|
-
// - matchOne(b/x/y/z/c, b/**/c)
|
|
24548
|
-
// - b matches b
|
|
24549
|
-
// - doublestar
|
|
24550
|
-
// - matchOne(x/y/z/c, c) -> no
|
|
24551
|
-
// - matchOne(y/z/c, c) -> no
|
|
24552
|
-
// - matchOne(z/c, c) -> no
|
|
24553
|
-
// - matchOne(c, c) yes, hit
|
|
24554
|
-
var fr = fi;
|
|
24555
|
-
var pr = pi + 1;
|
|
24556
|
-
if (pr === pl) {
|
|
24557
|
-
this.debug('** at the end');
|
|
24558
|
-
// a ** at the end will just swallow the rest.
|
|
24559
|
-
// We have found a match.
|
|
24560
|
-
// however, it will not swallow /.x, unless
|
|
24561
|
-
// options.dot is set.
|
|
24562
|
-
// . and .. are *never* matched by **, for explosively
|
|
24563
|
-
// exponential reasons.
|
|
24564
|
-
for (; fi < fl; fi++) {
|
|
24565
|
-
if (file[fi] === '.' ||
|
|
24566
|
-
file[fi] === '..' ||
|
|
24567
|
-
(!options.dot && file[fi].charAt(0) === '.'))
|
|
24568
|
-
return false;
|
|
24569
|
-
}
|
|
24570
|
-
return true;
|
|
24571
|
-
}
|
|
24572
|
-
// ok, let's see if we can swallow whatever we can.
|
|
24573
|
-
while (fr < fl) {
|
|
24574
|
-
var swallowee = file[fr];
|
|
24575
|
-
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
|
|
24576
|
-
// XXX remove this slice. Just pass the start index.
|
|
24577
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
24578
|
-
this.debug('globstar found match!', fr, fl, swallowee);
|
|
24579
|
-
// found a match.
|
|
24580
|
-
return true;
|
|
24581
|
-
}
|
|
24582
|
-
else {
|
|
24583
|
-
// can't swallow "." or ".." ever.
|
|
24584
|
-
// can only swallow ".foo" when explicitly asked.
|
|
24585
|
-
if (swallowee === '.' ||
|
|
24586
|
-
swallowee === '..' ||
|
|
24587
|
-
(!options.dot && swallowee.charAt(0) === '.')) {
|
|
24588
|
-
this.debug('dot detected!', file, fr, pattern, pr);
|
|
24589
|
-
break;
|
|
24590
|
-
}
|
|
24591
|
-
// ** swallows a segment, and continue.
|
|
24592
|
-
this.debug('globstar swallow a segment, and continue');
|
|
24593
|
-
fr++;
|
|
24594
|
-
}
|
|
24595
|
-
}
|
|
24596
|
-
// no match was found.
|
|
24597
|
-
// However, in partial mode, we can't say this is necessarily over.
|
|
24598
|
-
/* c8 ignore start */
|
|
24599
|
-
if (partial) {
|
|
24600
|
-
// ran out of file
|
|
24601
|
-
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
|
|
24602
|
-
if (fr === fl) {
|
|
24603
|
-
return true;
|
|
24604
|
-
}
|
|
24605
|
-
}
|
|
24606
|
-
/* c8 ignore stop */
|
|
24607
|
-
return false;
|
|
24608
|
-
}
|
|
24609
24940
|
// something other than **
|
|
24610
24941
|
// non-magic patterns just have to match exactly
|
|
24611
24942
|
// patterns with magic have been turned into regexps.
|
|
@@ -25065,8 +25396,12 @@ function requireCjs$1 () {
|
|
|
25065
25396
|
/** @import * as $typests from "./types.ts"; */
|
|
25066
25397
|
/** @typedef {$typests.BuiltInMergeStrategy} BuiltInMergeStrategy */
|
|
25067
25398
|
/** @typedef {$typests.BuiltInValidationStrategy} BuiltInValidationStrategy */
|
|
25399
|
+
/** @typedef {$typests.CustomMergeStrategy} CustomMergeStrategy */
|
|
25400
|
+
/** @typedef {$typests.CustomValidationStrategy} CustomValidationStrategy */
|
|
25068
25401
|
/** @typedef {$typests.ObjectDefinition} ObjectDefinition */
|
|
25069
25402
|
/** @typedef {$typests.PropertyDefinition} PropertyDefinition */
|
|
25403
|
+
/** @typedef {$typests.PropertyDefinitionWithSchema} PropertyDefinitionWithSchema */
|
|
25404
|
+
/** @typedef {$typests.PropertyDefinitionWithStrategies} PropertyDefinitionWithStrategies */
|
|
25070
25405
|
|
|
25071
25406
|
//-----------------------------------------------------------------------------
|
|
25072
25407
|
// Private
|
|
@@ -25579,6 +25914,9 @@ function requireCjs () {
|
|
|
25579
25914
|
|
|
25580
25915
|
/** @import * as $typests from "./types.ts"; */
|
|
25581
25916
|
/** @typedef {$typests.ConfigObject} ConfigObject */
|
|
25917
|
+
/** @typedef {$typests.FileMatcher} FileMatcher */
|
|
25918
|
+
/** @typedef {$typests.FilesMatcher} FilesMatcher */
|
|
25919
|
+
/** @typedef {$typests.ExtraConfigType} ExtraConfigType */
|
|
25582
25920
|
/** @import * as $minimatch from "minimatch"; */
|
|
25583
25921
|
/** @typedef {$minimatch.MinimatchOptions} MinimatchOptions */
|
|
25584
25922
|
/** @import * as PathImpl from "@jsr/std__path" */
|
|
@@ -25621,7 +25959,7 @@ function requireCjs () {
|
|
|
25621
25959
|
|
|
25622
25960
|
/**
|
|
25623
25961
|
* The types of config objects that are supported.
|
|
25624
|
-
* @type {Set<
|
|
25962
|
+
* @type {Set<ExtraConfigType>}
|
|
25625
25963
|
*/
|
|
25626
25964
|
const CONFIG_TYPES = new Set(["array", "function"]);
|
|
25627
25965
|
|
|
@@ -25706,7 +26044,7 @@ function requireCjs () {
|
|
|
25706
26044
|
|
|
25707
26045
|
/**
|
|
25708
26046
|
* Rethrows a config error with additional information about the config object.
|
|
25709
|
-
* @param {
|
|
26047
|
+
* @param {ConfigObject} config The config object to get the name of.
|
|
25710
26048
|
* @param {number} index The index of the config object in the array.
|
|
25711
26049
|
* @param {Error} error The error to rethrow.
|
|
25712
26050
|
* @throws {ConfigError} When the error is rethrown for a config.
|
|
@@ -25719,7 +26057,7 @@ function requireCjs () {
|
|
|
25719
26057
|
/**
|
|
25720
26058
|
* Shorthand for checking if a value is a string.
|
|
25721
26059
|
* @param {any} value The value to check.
|
|
25722
|
-
* @returns {
|
|
26060
|
+
* @returns {value is string} True if a string, false if not.
|
|
25723
26061
|
*/
|
|
25724
26062
|
function isString(value) {
|
|
25725
26063
|
return typeof value === "string";
|
|
@@ -25779,8 +26117,8 @@ function requireCjs () {
|
|
|
25779
26117
|
* faster matching speed over multiple file path evaluations.
|
|
25780
26118
|
* @param {string} filepath The file path to match.
|
|
25781
26119
|
* @param {string} pattern The glob pattern to match against.
|
|
25782
|
-
* @param {
|
|
25783
|
-
* @returns
|
|
26120
|
+
* @param {MinimatchOptions} options The minimatch options to use.
|
|
26121
|
+
* @returns {boolean} True if the file path matches, false if not.
|
|
25784
26122
|
*/
|
|
25785
26123
|
function doMatch(filepath, pattern, options = {}) {
|
|
25786
26124
|
let cache = minimatchCache;
|
|
@@ -25804,8 +26142,8 @@ function requireCjs () {
|
|
|
25804
26142
|
|
|
25805
26143
|
/**
|
|
25806
26144
|
* Normalizes a pattern by removing the leading "./" if present.
|
|
25807
|
-
* @param {
|
|
25808
|
-
* @returns {
|
|
26145
|
+
* @param {FileMatcher} pattern The pattern to normalize.
|
|
26146
|
+
* @returns {FileMatcher} The normalized pattern.
|
|
25809
26147
|
*/
|
|
25810
26148
|
function normalizePattern(pattern) {
|
|
25811
26149
|
if (isString(pattern)) {
|
|
@@ -25906,7 +26244,7 @@ function requireCjs () {
|
|
|
25906
26244
|
* @param {Array} items The items in a `ConfigArray`.
|
|
25907
26245
|
* @param {Object} context The context object to pass into any function
|
|
25908
26246
|
* found.
|
|
25909
|
-
* @param {
|
|
26247
|
+
* @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
|
|
25910
26248
|
* @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
|
|
25911
26249
|
* @param {PathImpl} path Path-handling implementation.
|
|
25912
26250
|
* @returns {Promise<Array>} A flattened array containing only config objects.
|
|
@@ -25954,7 +26292,7 @@ function requireCjs () {
|
|
|
25954
26292
|
* Async iterables cannot be used with the spread operator, so we need to manually
|
|
25955
26293
|
* create the array to return.
|
|
25956
26294
|
*/
|
|
25957
|
-
const asyncIterable =
|
|
26295
|
+
const asyncIterable = flatTraverse(items);
|
|
25958
26296
|
const configs = [];
|
|
25959
26297
|
|
|
25960
26298
|
for await (const config of asyncIterable) {
|
|
@@ -25970,7 +26308,7 @@ function requireCjs () {
|
|
|
25970
26308
|
* @param {Array} items The items in a `ConfigArray`.
|
|
25971
26309
|
* @param {Object} context The context object to pass into any function
|
|
25972
26310
|
* found.
|
|
25973
|
-
* @param {
|
|
26311
|
+
* @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
|
|
25974
26312
|
* @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
|
|
25975
26313
|
* @param {PathImpl} path Path-handling implementation
|
|
25976
26314
|
* @returns {Array} A flattened array containing only config objects.
|
|
@@ -26043,13 +26381,13 @@ function requireCjs () {
|
|
|
26043
26381
|
/**
|
|
26044
26382
|
* Determines if a given file path should be ignored based on the given
|
|
26045
26383
|
* matcher.
|
|
26046
|
-
* @param {Array<{ basePath?: string, ignores:
|
|
26384
|
+
* @param {Array<{ basePath?: string, ignores: FileMatcher[] }>} configs Configuration objects containing `ignores`.
|
|
26047
26385
|
* @param {string} filePath The unprocessed file path to check.
|
|
26048
26386
|
* @param {string} relativeFilePath The path of the file to check relative to the base path,
|
|
26049
26387
|
* using forward slash (`"/"`) as a separator.
|
|
26050
26388
|
* @param {Object} [basePathData] Additional data needed to recalculate paths for configuration objects
|
|
26051
26389
|
* that have `basePath` property.
|
|
26052
|
-
* @param {string} [basePathData.basePath] Namespaced path to
|
|
26390
|
+
* @param {string} [basePathData.basePath] Namespaced path to which `relativeFilePath` is relative.
|
|
26053
26391
|
* @param {PathImpl} [basePathData.path] Path-handling implementation.
|
|
26054
26392
|
* @returns {boolean} True if the path should be ignored and false if not.
|
|
26055
26393
|
*/
|
|
@@ -26118,7 +26456,7 @@ function requireCjs () {
|
|
|
26118
26456
|
* @param {string} filePath The unprocessed file path to check.
|
|
26119
26457
|
* @param {string} relativeFilePath The path of the file to check relative to the base path,
|
|
26120
26458
|
* using forward slash (`"/"`) as a separator.
|
|
26121
|
-
* @param {
|
|
26459
|
+
* @param {ConfigObject & { files: FilesMatcher[] }} config The config object to check.
|
|
26122
26460
|
* @returns {boolean} True if the file path is matched by the config,
|
|
26123
26461
|
* false if not.
|
|
26124
26462
|
*/
|
|
@@ -26181,21 +26519,23 @@ function requireCjs () {
|
|
|
26181
26519
|
|
|
26182
26520
|
/**
|
|
26183
26521
|
* Ensures that config types are valid.
|
|
26184
|
-
* @param {
|
|
26522
|
+
* @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
|
|
26185
26523
|
* @returns {void}
|
|
26186
26524
|
* @throws {TypeError} When the config types array is invalid.
|
|
26187
26525
|
*/
|
|
26188
26526
|
function assertExtraConfigTypes(extraConfigTypes) {
|
|
26527
|
+
if (!Array.isArray(extraConfigTypes)) {
|
|
26528
|
+
throw new TypeError("extraConfigTypes must be an array.");
|
|
26529
|
+
}
|
|
26530
|
+
|
|
26189
26531
|
if (extraConfigTypes.length > 2) {
|
|
26190
|
-
throw new TypeError(
|
|
26191
|
-
"configTypes must be an array with at most two items.",
|
|
26192
|
-
);
|
|
26532
|
+
throw new TypeError("extraConfigTypes must contain at most two items.");
|
|
26193
26533
|
}
|
|
26194
26534
|
|
|
26195
26535
|
for (const configType of extraConfigTypes) {
|
|
26196
26536
|
if (!CONFIG_TYPES.has(configType)) {
|
|
26197
26537
|
throw new TypeError(
|
|
26198
|
-
`Unexpected config type "${configType}"
|
|
26538
|
+
`Unexpected config type "${configType}" in extraConfigTypes. Expected one of: "array", "function".`,
|
|
26199
26539
|
);
|
|
26200
26540
|
}
|
|
26201
26541
|
}
|
|
@@ -26266,9 +26606,9 @@ function requireCjs () {
|
|
|
26266
26606
|
* Defaults to `"/"`.
|
|
26267
26607
|
* @param {boolean} [options.normalized=false] Flag indicating if the
|
|
26268
26608
|
* configs have already been normalized.
|
|
26269
|
-
* @param {
|
|
26609
|
+
* @param {ObjectDefinition} [options.schema] The additional schema
|
|
26270
26610
|
* definitions to use for the ConfigArray schema.
|
|
26271
|
-
* @param {
|
|
26611
|
+
* @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
|
|
26272
26612
|
* @throws {TypeError} When the `basePath` is not a non-empty string,
|
|
26273
26613
|
*/
|
|
26274
26614
|
constructor(
|
|
@@ -26316,7 +26656,7 @@ function requireCjs () {
|
|
|
26316
26656
|
|
|
26317
26657
|
/**
|
|
26318
26658
|
* The supported config types.
|
|
26319
|
-
* @type {
|
|
26659
|
+
* @type {ReadonlyArray<ExtraConfigType>}
|
|
26320
26660
|
*/
|
|
26321
26661
|
this.extraConfigTypes = [...extraConfigTypes];
|
|
26322
26662
|
Object.freeze(this.extraConfigTypes);
|
|
@@ -26369,7 +26709,7 @@ function requireCjs () {
|
|
|
26369
26709
|
* This can be used to determine which files will be matched by a
|
|
26370
26710
|
* config array or to use as a glob pattern when no patterns are provided
|
|
26371
26711
|
* for a command line interface.
|
|
26372
|
-
* @returns {Array<
|
|
26712
|
+
* @returns {Array<FilesMatcher>} An array of matchers.
|
|
26373
26713
|
*/
|
|
26374
26714
|
get files() {
|
|
26375
26715
|
assertNormalized(this);
|
|
@@ -26405,7 +26745,7 @@ function requireCjs () {
|
|
|
26405
26745
|
* the matching `files` fields in any configs. This is necessary to mimic
|
|
26406
26746
|
* the behavior of things like .gitignore and .eslintignore, allowing a
|
|
26407
26747
|
* globbing operation to be faster.
|
|
26408
|
-
* @returns {
|
|
26748
|
+
* @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
|
|
26409
26749
|
*/
|
|
26410
26750
|
get ignores() {
|
|
26411
26751
|
assertNormalized(this);
|
|
@@ -26424,7 +26764,7 @@ function requireCjs () {
|
|
|
26424
26764
|
for (const config of this) {
|
|
26425
26765
|
/*
|
|
26426
26766
|
* We only count ignores if there are no other keys in the object.
|
|
26427
|
-
* In this case, it acts
|
|
26767
|
+
* In this case, it acts like a globally ignored pattern. If there
|
|
26428
26768
|
* are additional keys, then ignores act like exclusions.
|
|
26429
26769
|
*/
|
|
26430
26770
|
if (
|
|
@@ -45691,6 +46031,13 @@ function requireAstUtils () {
|
|
|
45691
46031
|
const globals = requireGlobals();
|
|
45692
46032
|
const { LATEST_ECMA_VERSION } = requireEcmaVersion();
|
|
45693
46033
|
|
|
46034
|
+
//------------------------------------------------------------------------------
|
|
46035
|
+
// Types
|
|
46036
|
+
//------------------------------------------------------------------------------
|
|
46037
|
+
|
|
46038
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
46039
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
46040
|
+
|
|
45694
46041
|
//------------------------------------------------------------------------------
|
|
45695
46042
|
// Helpers
|
|
45696
46043
|
//------------------------------------------------------------------------------
|
|
@@ -47250,9 +47597,9 @@ function requireAstUtils () {
|
|
|
47250
47597
|
|
|
47251
47598
|
/**
|
|
47252
47599
|
* Finds the variable by a given name in a given scope and its upper scopes.
|
|
47253
|
-
* @param {
|
|
47600
|
+
* @param {Scope} initScope A scope to start find.
|
|
47254
47601
|
* @param {string} name A variable name to find.
|
|
47255
|
-
* @returns {
|
|
47602
|
+
* @returns {Variable|null} A found variable or `null`.
|
|
47256
47603
|
*/
|
|
47257
47604
|
getVariableByName(initScope, name) {
|
|
47258
47605
|
let scope = initScope;
|
|
@@ -47279,7 +47626,7 @@ function requireAstUtils () {
|
|
|
47279
47626
|
* - The given node is not `StaticBlock`.
|
|
47280
47627
|
* - The function name does not start with uppercase. It's a convention to capitalize the names
|
|
47281
47628
|
* of constructor functions. This check is not performed if `capIsConstructor` is set to `false`.
|
|
47282
|
-
* - The function does not have a JSDoc comment that has a
|
|
47629
|
+
* - The function does not have a JSDoc comment that has a `@this` tag.
|
|
47283
47630
|
*
|
|
47284
47631
|
* Next, this checks the location of the node.
|
|
47285
47632
|
* If the location is below, this judges `this` is valid.
|
|
@@ -51331,6 +51678,13 @@ function requireBlockScopedVar () {
|
|
|
51331
51678
|
if (hasRequiredBlockScopedVar) return blockScopedVar;
|
|
51332
51679
|
hasRequiredBlockScopedVar = 1;
|
|
51333
51680
|
|
|
51681
|
+
//------------------------------------------------------------------------------
|
|
51682
|
+
// Types
|
|
51683
|
+
//------------------------------------------------------------------------------
|
|
51684
|
+
|
|
51685
|
+
/** @typedef {import("eslint-scope").Definition} Definition */
|
|
51686
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
51687
|
+
|
|
51334
51688
|
//------------------------------------------------------------------------------
|
|
51335
51689
|
// Rule Definition
|
|
51336
51690
|
//------------------------------------------------------------------------------
|
|
@@ -51378,8 +51732,8 @@ function requireBlockScopedVar () {
|
|
|
51378
51732
|
|
|
51379
51733
|
/**
|
|
51380
51734
|
* Reports a given reference.
|
|
51381
|
-
* @param {
|
|
51382
|
-
* @param {
|
|
51735
|
+
* @param {Reference} reference A reference to report.
|
|
51736
|
+
* @param {Definition} definition A definition for which to report reference.
|
|
51383
51737
|
* @returns {void}
|
|
51384
51738
|
*/
|
|
51385
51739
|
function report(reference, definition) {
|
|
@@ -57994,9 +58348,19 @@ function requireFuncNames () {
|
|
|
57994
58348
|
|
|
57995
58349
|
const astUtils = requireAstUtils();
|
|
57996
58350
|
|
|
58351
|
+
//------------------------------------------------------------------------------
|
|
58352
|
+
// Types
|
|
58353
|
+
//------------------------------------------------------------------------------
|
|
58354
|
+
|
|
58355
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
58356
|
+
|
|
58357
|
+
//------------------------------------------------------------------------------
|
|
58358
|
+
// Helpers
|
|
58359
|
+
//------------------------------------------------------------------------------
|
|
58360
|
+
|
|
57997
58361
|
/**
|
|
57998
58362
|
* Checks whether or not a given variable is a function name.
|
|
57999
|
-
* @param {
|
|
58363
|
+
* @param {Variable} variable A variable to check.
|
|
58000
58364
|
* @returns {boolean} `true` if the variable is a function name.
|
|
58001
58365
|
*/
|
|
58002
58366
|
function isFunctionName(variable) {
|
|
@@ -74598,6 +74962,12 @@ function requireNoConsole () {
|
|
|
74598
74962
|
|
|
74599
74963
|
const astUtils = requireAstUtils();
|
|
74600
74964
|
|
|
74965
|
+
//------------------------------------------------------------------------------
|
|
74966
|
+
// Types
|
|
74967
|
+
//------------------------------------------------------------------------------
|
|
74968
|
+
|
|
74969
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
74970
|
+
|
|
74601
74971
|
//------------------------------------------------------------------------------
|
|
74602
74972
|
// Rule Definition
|
|
74603
74973
|
//------------------------------------------------------------------------------
|
|
@@ -74649,7 +75019,7 @@ function requireNoConsole () {
|
|
|
74649
75019
|
|
|
74650
75020
|
/**
|
|
74651
75021
|
* Checks whether the given reference is 'console' or not.
|
|
74652
|
-
* @param {
|
|
75022
|
+
* @param {Reference} reference The reference to check.
|
|
74653
75023
|
* @returns {boolean} `true` if the reference is 'console'.
|
|
74654
75024
|
*/
|
|
74655
75025
|
function isConsole(reference) {
|
|
@@ -74673,7 +75043,7 @@ function requireNoConsole () {
|
|
|
74673
75043
|
/**
|
|
74674
75044
|
* Checks whether the given reference is a member access which is not
|
|
74675
75045
|
* allowed by options or not.
|
|
74676
|
-
* @param {
|
|
75046
|
+
* @param {Reference} reference The reference to check.
|
|
74677
75047
|
* @returns {boolean} `true` if the reference is a member access which
|
|
74678
75048
|
* is not allowed by options.
|
|
74679
75049
|
*/
|
|
@@ -74750,7 +75120,7 @@ function requireNoConsole () {
|
|
|
74750
75120
|
|
|
74751
75121
|
/**
|
|
74752
75122
|
* Reports the given reference as a violation.
|
|
74753
|
-
* @param {
|
|
75123
|
+
* @param {Reference} reference The reference to report.
|
|
74754
75124
|
* @returns {void}
|
|
74755
75125
|
*/
|
|
74756
75126
|
function report(reference) {
|
|
@@ -79188,6 +79558,12 @@ function requireNoDupeArgs () {
|
|
|
79188
79558
|
|
|
79189
79559
|
const astUtils = requireAstUtils();
|
|
79190
79560
|
|
|
79561
|
+
//------------------------------------------------------------------------------
|
|
79562
|
+
// Types
|
|
79563
|
+
//------------------------------------------------------------------------------
|
|
79564
|
+
|
|
79565
|
+
/** @typedef {import("eslint-scope").Definition} Definition */
|
|
79566
|
+
|
|
79191
79567
|
//------------------------------------------------------------------------------
|
|
79192
79568
|
// Rule Definition
|
|
79193
79569
|
//------------------------------------------------------------------------------
|
|
@@ -79220,7 +79596,7 @@ function requireNoDupeArgs () {
|
|
|
79220
79596
|
|
|
79221
79597
|
/**
|
|
79222
79598
|
* Checks whether or not a given definition is a parameter's.
|
|
79223
|
-
* @param {
|
|
79599
|
+
* @param {Definition} def A definition to check.
|
|
79224
79600
|
* @returns {boolean} `true` if the definition is a parameter's.
|
|
79225
79601
|
*/
|
|
79226
79602
|
function isParameter(def) {
|
|
@@ -80337,6 +80713,12 @@ function requireNoElseReturn () {
|
|
|
80337
80713
|
const astUtils = requireAstUtils();
|
|
80338
80714
|
const FixTracker = requireFixTracker();
|
|
80339
80715
|
|
|
80716
|
+
//------------------------------------------------------------------------------
|
|
80717
|
+
// Types
|
|
80718
|
+
//------------------------------------------------------------------------------
|
|
80719
|
+
|
|
80720
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
80721
|
+
|
|
80340
80722
|
//------------------------------------------------------------------------------
|
|
80341
80723
|
// Rule Definition
|
|
80342
80724
|
//------------------------------------------------------------------------------
|
|
@@ -80391,7 +80773,7 @@ function requireNoElseReturn () {
|
|
|
80391
80773
|
* This is not a generic function. In particular, it is assumed that the scope is a function scope or
|
|
80392
80774
|
* a function's inner scope, and that the names can be valid identifiers in the given scope.
|
|
80393
80775
|
* @param {string[]} names Array of variable names.
|
|
80394
|
-
* @param {
|
|
80776
|
+
* @param {Scope} scope Function scope or a function's inner scope.
|
|
80395
80777
|
* @returns {boolean} True if all names can be safely declared, false otherwise.
|
|
80396
80778
|
*/
|
|
80397
80779
|
function isSafeToDeclare(names, scope) {
|
|
@@ -80483,7 +80865,7 @@ function requireNoElseReturn () {
|
|
|
80483
80865
|
/**
|
|
80484
80866
|
* Checks whether the removal of `else` and its braces is safe from variable name collisions.
|
|
80485
80867
|
* @param {Node} node The 'else' node.
|
|
80486
|
-
* @param {
|
|
80868
|
+
* @param {Scope} scope The scope in which the node and the whole 'if' statement is.
|
|
80487
80869
|
* @returns {boolean} True if it is safe, false otherwise.
|
|
80488
80870
|
*/
|
|
80489
80871
|
function isSafeFromNameCollisions(node, scope) {
|
|
@@ -81526,6 +81908,12 @@ function requireNoEval () {
|
|
|
81526
81908
|
|
|
81527
81909
|
const astUtils = requireAstUtils();
|
|
81528
81910
|
|
|
81911
|
+
//------------------------------------------------------------------------------
|
|
81912
|
+
// Types
|
|
81913
|
+
//------------------------------------------------------------------------------
|
|
81914
|
+
|
|
81915
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
81916
|
+
|
|
81529
81917
|
//------------------------------------------------------------------------------
|
|
81530
81918
|
// Helpers
|
|
81531
81919
|
//------------------------------------------------------------------------------
|
|
@@ -81653,7 +82041,7 @@ function requireNoEval () {
|
|
|
81653
82041
|
|
|
81654
82042
|
/**
|
|
81655
82043
|
* Reports accesses of `eval` via the global object.
|
|
81656
|
-
* @param {
|
|
82044
|
+
* @param {Scope} globalScope The global scope.
|
|
81657
82045
|
* @returns {void}
|
|
81658
82046
|
*/
|
|
81659
82047
|
function reportAccessingEvalViaGlobalObject(globalScope) {
|
|
@@ -81686,7 +82074,7 @@ function requireNoEval () {
|
|
|
81686
82074
|
|
|
81687
82075
|
/**
|
|
81688
82076
|
* Reports all accesses of `eval` (excludes direct calls to eval).
|
|
81689
|
-
* @param {
|
|
82077
|
+
* @param {Scope} globalScope The global scope.
|
|
81690
82078
|
* @returns {void}
|
|
81691
82079
|
*/
|
|
81692
82080
|
function reportAccessingEval(globalScope) {
|
|
@@ -88026,6 +88414,12 @@ function requireNoLoopFunc () {
|
|
|
88026
88414
|
if (hasRequiredNoLoopFunc) return noLoopFunc;
|
|
88027
88415
|
hasRequiredNoLoopFunc = 1;
|
|
88028
88416
|
|
|
88417
|
+
//------------------------------------------------------------------------------
|
|
88418
|
+
// Types
|
|
88419
|
+
//------------------------------------------------------------------------------
|
|
88420
|
+
|
|
88421
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
88422
|
+
|
|
88029
88423
|
//------------------------------------------------------------------------------
|
|
88030
88424
|
// Helpers
|
|
88031
88425
|
//------------------------------------------------------------------------------
|
|
@@ -88157,7 +88551,7 @@ function requireNoLoopFunc () {
|
|
|
88157
88551
|
* Checks whether a given reference which refers to an upper scope's variable is
|
|
88158
88552
|
* safe or not.
|
|
88159
88553
|
* @param {ASTNode} loopNode A containing loop node.
|
|
88160
|
-
* @param {
|
|
88554
|
+
* @param {Reference} reference A reference to check.
|
|
88161
88555
|
* @returns {boolean} `true` if the reference is safe or not.
|
|
88162
88556
|
*/
|
|
88163
88557
|
function isSafe(loopNode, reference) {
|
|
@@ -88203,7 +88597,7 @@ function requireNoLoopFunc () {
|
|
|
88203
88597
|
* It's safe if the reference matches one of the following condition.
|
|
88204
88598
|
* - is readonly.
|
|
88205
88599
|
* - doesn't exist inside a local function and after the border.
|
|
88206
|
-
* @param {
|
|
88600
|
+
* @param {Reference} upperRef A reference to check.
|
|
88207
88601
|
* @returns {boolean} `true` if the reference is safe.
|
|
88208
88602
|
*/
|
|
88209
88603
|
function isSafeReference(upperRef) {
|
|
@@ -88931,10 +89325,10 @@ function requireIsCombiningCharacter () {
|
|
|
88931
89325
|
/**
|
|
88932
89326
|
* Check whether a given character is a combining mark or not.
|
|
88933
89327
|
* @param {number} codePoint The character code to check.
|
|
88934
|
-
* @returns {boolean} `true` if the character
|
|
89328
|
+
* @returns {boolean} `true` if the character has the General Category of Combining Mark (M), consisting of `Mc`, `Me`, and `Mn`.
|
|
88935
89329
|
*/
|
|
88936
89330
|
isCombiningCharacter = function isCombiningCharacter(codePoint) {
|
|
88937
|
-
return
|
|
89331
|
+
return /^\p{M}$/u.test(String.fromCodePoint(codePoint));
|
|
88938
89332
|
};
|
|
88939
89333
|
return isCombiningCharacter;
|
|
88940
89334
|
}
|
|
@@ -97837,6 +98231,12 @@ function requireNoShadow () {
|
|
|
97837
98231
|
|
|
97838
98232
|
const astUtils = requireAstUtils();
|
|
97839
98233
|
|
|
98234
|
+
//------------------------------------------------------------------------------
|
|
98235
|
+
// Types
|
|
98236
|
+
//------------------------------------------------------------------------------
|
|
98237
|
+
|
|
98238
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
98239
|
+
|
|
97840
98240
|
//------------------------------------------------------------------------------
|
|
97841
98241
|
// Helpers
|
|
97842
98242
|
//------------------------------------------------------------------------------
|
|
@@ -98278,7 +98678,7 @@ function requireNoShadow () {
|
|
|
98278
98678
|
|
|
98279
98679
|
/**
|
|
98280
98680
|
* Get declared line and column of a variable.
|
|
98281
|
-
* @param {
|
|
98681
|
+
* @param {Variable} variable The variable to get.
|
|
98282
98682
|
* @returns {Object} The declared line and column of the variable.
|
|
98283
98683
|
*/
|
|
98284
98684
|
function getDeclaredLocation(variable) {
|
|
@@ -100101,6 +100501,12 @@ function requireNoUndefined () {
|
|
|
100101
100501
|
if (hasRequiredNoUndefined) return noUndefined;
|
|
100102
100502
|
hasRequiredNoUndefined = 1;
|
|
100103
100503
|
|
|
100504
|
+
//------------------------------------------------------------------------------
|
|
100505
|
+
// Types
|
|
100506
|
+
//------------------------------------------------------------------------------
|
|
100507
|
+
|
|
100508
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
100509
|
+
|
|
100104
100510
|
//------------------------------------------------------------------------------
|
|
100105
100511
|
// Rule Definition
|
|
100106
100512
|
//------------------------------------------------------------------------------
|
|
@@ -100142,7 +100548,7 @@ function requireNoUndefined () {
|
|
|
100142
100548
|
/**
|
|
100143
100549
|
* Checks the given scope for references to `undefined` and reports
|
|
100144
100550
|
* all references found.
|
|
100145
|
-
* @param {
|
|
100551
|
+
* @param {Scope} scope The scope to check.
|
|
100146
100552
|
* @returns {void}
|
|
100147
100553
|
*/
|
|
100148
100554
|
function checkScope(scope) {
|
|
@@ -100732,6 +101138,13 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100732
101138
|
const Traverser = requireTraverser(),
|
|
100733
101139
|
astUtils = requireAstUtils();
|
|
100734
101140
|
|
|
101141
|
+
//------------------------------------------------------------------------------
|
|
101142
|
+
// Types
|
|
101143
|
+
//------------------------------------------------------------------------------
|
|
101144
|
+
|
|
101145
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
101146
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
101147
|
+
|
|
100735
101148
|
//------------------------------------------------------------------------------
|
|
100736
101149
|
// Helpers
|
|
100737
101150
|
//------------------------------------------------------------------------------
|
|
@@ -100745,7 +101158,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100745
101158
|
|
|
100746
101159
|
/**
|
|
100747
101160
|
* @typedef {Object} LoopConditionInfo
|
|
100748
|
-
* @property {
|
|
101161
|
+
* @property {Reference} reference - The reference.
|
|
100749
101162
|
* @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes
|
|
100750
101163
|
* that the reference is belonging to.
|
|
100751
101164
|
* @property {Function} isInLoop - The predicate which checks a given reference
|
|
@@ -100756,7 +101169,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100756
101169
|
|
|
100757
101170
|
/**
|
|
100758
101171
|
* Checks whether or not a given reference is a write reference.
|
|
100759
|
-
* @param {
|
|
101172
|
+
* @param {Reference} reference A reference to check.
|
|
100760
101173
|
* @returns {boolean} `true` if the reference is a write reference.
|
|
100761
101174
|
*/
|
|
100762
101175
|
function isWriteReference(reference) {
|
|
@@ -100793,7 +101206,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100793
101206
|
/**
|
|
100794
101207
|
* Checks whether or not a given reference is inside of a given node.
|
|
100795
101208
|
* @param {ASTNode} node A node to check.
|
|
100796
|
-
* @param {
|
|
101209
|
+
* @param {Reference} reference A reference to check.
|
|
100797
101210
|
* @returns {boolean} `true` if the reference is inside of the node.
|
|
100798
101211
|
*/
|
|
100799
101212
|
function isInRange(node, reference) {
|
|
@@ -100806,7 +101219,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100806
101219
|
/**
|
|
100807
101220
|
* Checks whether or not a given reference is inside of a loop node's condition.
|
|
100808
101221
|
* @param {ASTNode} node A node to check.
|
|
100809
|
-
* @param {
|
|
101222
|
+
* @param {Reference} reference A reference to check.
|
|
100810
101223
|
* @returns {boolean} `true` if the reference is inside of the loop node's
|
|
100811
101224
|
* condition.
|
|
100812
101225
|
*/
|
|
@@ -100824,7 +101237,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100824
101237
|
/**
|
|
100825
101238
|
* Gets the function which encloses a given reference.
|
|
100826
101239
|
* This supports only FunctionDeclaration.
|
|
100827
|
-
* @param {
|
|
101240
|
+
* @param {Reference} reference A reference to get.
|
|
100828
101241
|
* @returns {ASTNode|null} The function node or null.
|
|
100829
101242
|
*/
|
|
100830
101243
|
function getEncloseFunctionDeclaration(reference) {
|
|
@@ -100844,7 +101257,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100844
101257
|
/**
|
|
100845
101258
|
* Updates the "modified" flags of given loop conditions with given modifiers.
|
|
100846
101259
|
* @param {LoopConditionInfo[]} conditions The loop conditions to be updated.
|
|
100847
|
-
* @param {
|
|
101260
|
+
* @param {Reference[]} modifiers The references to update.
|
|
100848
101261
|
* @returns {void}
|
|
100849
101262
|
*/
|
|
100850
101263
|
function updateModifiedFlag(conditions, modifiers) {
|
|
@@ -100978,7 +101391,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
100978
101391
|
|
|
100979
101392
|
/**
|
|
100980
101393
|
* Creates the loop condition information from a given reference.
|
|
100981
|
-
* @param {
|
|
101394
|
+
* @param {Reference} reference A reference to create.
|
|
100982
101395
|
* @returns {LoopConditionInfo|null} Created loop condition info, or null.
|
|
100983
101396
|
*/
|
|
100984
101397
|
function toLoopCondition(reference) {
|
|
@@ -101029,7 +101442,7 @@ function requireNoUnmodifiedLoopCondition () {
|
|
|
101029
101442
|
/**
|
|
101030
101443
|
* Finds unmodified references which are inside of a loop condition.
|
|
101031
101444
|
* Then reports the references which are outside of groups.
|
|
101032
|
-
* @param {
|
|
101445
|
+
* @param {Variable} variable A variable to report.
|
|
101033
101446
|
* @returns {void}
|
|
101034
101447
|
*/
|
|
101035
101448
|
function checkReferences(variable) {
|
|
@@ -102989,6 +103402,13 @@ function requireNoUnusedVars () {
|
|
|
102989
103402
|
|
|
102990
103403
|
const astUtils = requireAstUtils();
|
|
102991
103404
|
|
|
103405
|
+
//------------------------------------------------------------------------------
|
|
103406
|
+
// Types
|
|
103407
|
+
//------------------------------------------------------------------------------
|
|
103408
|
+
|
|
103409
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
103410
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
103411
|
+
|
|
102992
103412
|
//------------------------------------------------------------------------------
|
|
102993
103413
|
// Typedefs
|
|
102994
103414
|
//------------------------------------------------------------------------------
|
|
@@ -103502,7 +103922,7 @@ function requireNoUnusedVars () {
|
|
|
103502
103922
|
* - The reference is inside of a loop.
|
|
103503
103923
|
* - The reference is inside of a function scope which is different from
|
|
103504
103924
|
* the declaration.
|
|
103505
|
-
* @param {
|
|
103925
|
+
* @param {Reference} ref A reference to check.
|
|
103506
103926
|
* @param {ASTNode} prevRhsNode The previous RHS node.
|
|
103507
103927
|
* @returns {ASTNode|null} The RHS node or null.
|
|
103508
103928
|
* @private
|
|
@@ -103609,7 +104029,7 @@ function requireNoUnusedVars () {
|
|
|
103609
104029
|
|
|
103610
104030
|
/**
|
|
103611
104031
|
* Checks whether a given reference is a read to update itself or not.
|
|
103612
|
-
* @param {
|
|
104032
|
+
* @param {Reference} ref A reference to check.
|
|
103613
104033
|
* @param {ASTNode} rhsNode The RHS node of the previous assignment.
|
|
103614
104034
|
* @returns {boolean} The reference is a read to update itself.
|
|
103615
104035
|
* @private
|
|
@@ -103710,7 +104130,7 @@ function requireNoUnusedVars () {
|
|
|
103710
104130
|
|
|
103711
104131
|
/**
|
|
103712
104132
|
* Checks whether the given variable is after the last used parameter.
|
|
103713
|
-
* @param {
|
|
104133
|
+
* @param {Variable} variable The variable to check.
|
|
103714
104134
|
* @returns {boolean} `true` if the variable is defined after the last
|
|
103715
104135
|
* used parameter.
|
|
103716
104136
|
*/
|
|
@@ -104730,6 +105150,13 @@ function requireNoUseBeforeDefine () {
|
|
|
104730
105150
|
if (hasRequiredNoUseBeforeDefine) return noUseBeforeDefine;
|
|
104731
105151
|
hasRequiredNoUseBeforeDefine = 1;
|
|
104732
105152
|
|
|
105153
|
+
//------------------------------------------------------------------------------
|
|
105154
|
+
// Types
|
|
105155
|
+
//------------------------------------------------------------------------------
|
|
105156
|
+
|
|
105157
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
105158
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
105159
|
+
|
|
104733
105160
|
//------------------------------------------------------------------------------
|
|
104734
105161
|
// Helpers
|
|
104735
105162
|
//------------------------------------------------------------------------------
|
|
@@ -104793,7 +105220,7 @@ function requireNoUseBeforeDefine () {
|
|
|
104793
105220
|
/**
|
|
104794
105221
|
* Checks whether a given scope is the scope of a class static initializer.
|
|
104795
105222
|
* Static initializers are static blocks and initializers of static fields.
|
|
104796
|
-
* @param {
|
|
105223
|
+
* @param {Scope} scope A scope to check.
|
|
104797
105224
|
* @returns {boolean} `true` if the scope is a class static initializer scope.
|
|
104798
105225
|
*/
|
|
104799
105226
|
function isClassStaticInitializerScope(scope) {
|
|
@@ -104844,7 +105271,7 @@ function requireNoUseBeforeDefine () {
|
|
|
104844
105271
|
* x; // returns `false`
|
|
104845
105272
|
* }
|
|
104846
105273
|
* }
|
|
104847
|
-
* @param {
|
|
105274
|
+
* @param {Reference} reference A reference to check.
|
|
104848
105275
|
* @returns {boolean} `true` if the reference is from a separate execution context.
|
|
104849
105276
|
*/
|
|
104850
105277
|
function isFromSeparateExecutionContext(reference) {
|
|
@@ -105058,7 +105485,7 @@ function requireNoUseBeforeDefine () {
|
|
|
105058
105485
|
* - referring to a variable that is defined, but not in the given source code
|
|
105059
105486
|
* (e.g., global environment variable or `arguments` in functions).
|
|
105060
105487
|
* - allowed by options.
|
|
105061
|
-
* @param {
|
|
105488
|
+
* @param {Reference} reference The reference
|
|
105062
105489
|
* @returns {boolean} `true` if the reference should be checked
|
|
105063
105490
|
*/
|
|
105064
105491
|
function shouldCheck(reference) {
|
|
@@ -105137,7 +105564,7 @@ function requireNoUseBeforeDefine () {
|
|
|
105137
105564
|
|
|
105138
105565
|
/**
|
|
105139
105566
|
* Finds and validates all references in a given scope and its child scopes.
|
|
105140
|
-
* @param {
|
|
105567
|
+
* @param {Scope} scope The scope object.
|
|
105141
105568
|
* @returns {void}
|
|
105142
105569
|
*/
|
|
105143
105570
|
function checkReferencesInScope(scope) {
|
|
@@ -105317,7 +105744,7 @@ function requireNoUselessAssignment () {
|
|
|
105317
105744
|
|
|
105318
105745
|
messages: {
|
|
105319
105746
|
unnecessaryAssignment:
|
|
105320
|
-
"
|
|
105747
|
+
"The value assigned to '{{name}}' is not used in subsequent statements.",
|
|
105321
105748
|
},
|
|
105322
105749
|
},
|
|
105323
105750
|
|
|
@@ -105665,6 +106092,7 @@ function requireNoUselessAssignment () {
|
|
|
105665
106092
|
context.report({
|
|
105666
106093
|
node: targetAssignment.identifier,
|
|
105667
106094
|
messageId: "unnecessaryAssignment",
|
|
106095
|
+
data: { name: targetAssignment.identifier.name },
|
|
105668
106096
|
});
|
|
105669
106097
|
}
|
|
105670
106098
|
|
|
@@ -107942,13 +108370,21 @@ function requireNoVar () {
|
|
|
107942
108370
|
|
|
107943
108371
|
const astUtils = requireAstUtils();
|
|
107944
108372
|
|
|
108373
|
+
//------------------------------------------------------------------------------
|
|
108374
|
+
// Types
|
|
108375
|
+
//------------------------------------------------------------------------------
|
|
108376
|
+
|
|
108377
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
108378
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
108379
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
108380
|
+
|
|
107945
108381
|
//------------------------------------------------------------------------------
|
|
107946
108382
|
// Helpers
|
|
107947
108383
|
//------------------------------------------------------------------------------
|
|
107948
108384
|
|
|
107949
108385
|
/**
|
|
107950
108386
|
* Check whether a given variable is a global variable or not.
|
|
107951
|
-
* @param {
|
|
108387
|
+
* @param {Variable} variable The variable to check.
|
|
107952
108388
|
* @returns {boolean} `true` if the variable is a global variable.
|
|
107953
108389
|
*/
|
|
107954
108390
|
function isGlobal(variable) {
|
|
@@ -107958,8 +108394,8 @@ function requireNoVar () {
|
|
|
107958
108394
|
/**
|
|
107959
108395
|
* Finds the nearest function scope or global scope walking up the scope
|
|
107960
108396
|
* hierarchy.
|
|
107961
|
-
* @param {
|
|
107962
|
-
* @returns {
|
|
108397
|
+
* @param {Scope} scope The scope to traverse.
|
|
108398
|
+
* @returns {Scope} a function scope or global scope containing the given
|
|
107963
108399
|
* scope.
|
|
107964
108400
|
*/
|
|
107965
108401
|
function getEnclosingFunctionScope(scope) {
|
|
@@ -107974,7 +108410,7 @@ function requireNoVar () {
|
|
|
107974
108410
|
/**
|
|
107975
108411
|
* Checks whether the given variable has any references from a more specific
|
|
107976
108412
|
* function expression (i.e. a closure).
|
|
107977
|
-
* @param {
|
|
108413
|
+
* @param {Variable} variable A variable to check.
|
|
107978
108414
|
* @returns {boolean} `true` if the variable is used from a closure.
|
|
107979
108415
|
*/
|
|
107980
108416
|
function isReferencedInClosure(variable) {
|
|
@@ -108038,7 +108474,7 @@ function requireNoVar () {
|
|
|
108038
108474
|
|
|
108039
108475
|
/**
|
|
108040
108476
|
* Checks whether a given variable is redeclared or not.
|
|
108041
|
-
* @param {
|
|
108477
|
+
* @param {Variable} variable A variable to check.
|
|
108042
108478
|
* @returns {boolean} `true` if the variable is redeclared.
|
|
108043
108479
|
*/
|
|
108044
108480
|
function isRedeclared(variable) {
|
|
@@ -108054,7 +108490,7 @@ function requireNoVar () {
|
|
|
108054
108490
|
function isUsedFromOutsideOf(scopeNode) {
|
|
108055
108491
|
/**
|
|
108056
108492
|
* Checks whether a given reference is inside of the specified scope or not.
|
|
108057
|
-
* @param {
|
|
108493
|
+
* @param {Reference} reference A reference to check.
|
|
108058
108494
|
* @returns {boolean} `true` if the reference is inside of the specified
|
|
108059
108495
|
* scope.
|
|
108060
108496
|
*/
|
|
@@ -108115,7 +108551,7 @@ function requireNoVar () {
|
|
|
108115
108551
|
/**
|
|
108116
108552
|
* Checks whether a given variable has name that is allowed for 'var' declarations,
|
|
108117
108553
|
* but disallowed for `let` declarations.
|
|
108118
|
-
* @param {
|
|
108554
|
+
* @param {Variable} variable The variable to check.
|
|
108119
108555
|
* @returns {boolean} `true` if the variable has a disallowed name.
|
|
108120
108556
|
*/
|
|
108121
108557
|
function hasNameDisallowedForLetDeclarations(variable) {
|
|
@@ -113018,13 +113454,20 @@ function requirePreferArrowCallback () {
|
|
|
113018
113454
|
|
|
113019
113455
|
const astUtils = requireAstUtils();
|
|
113020
113456
|
|
|
113457
|
+
//------------------------------------------------------------------------------
|
|
113458
|
+
// Types
|
|
113459
|
+
//------------------------------------------------------------------------------
|
|
113460
|
+
|
|
113461
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
113462
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
113463
|
+
|
|
113021
113464
|
//------------------------------------------------------------------------------
|
|
113022
113465
|
// Helpers
|
|
113023
113466
|
//------------------------------------------------------------------------------
|
|
113024
113467
|
|
|
113025
113468
|
/**
|
|
113026
113469
|
* Checks whether or not a given variable is a function name.
|
|
113027
|
-
* @param {
|
|
113470
|
+
* @param {Variable} variable A variable to check.
|
|
113028
113471
|
* @returns {boolean} `true` if the variable is a function name.
|
|
113029
113472
|
*/
|
|
113030
113473
|
function isFunctionName(variable) {
|
|
@@ -113044,8 +113487,8 @@ function requirePreferArrowCallback () {
|
|
|
113044
113487
|
|
|
113045
113488
|
/**
|
|
113046
113489
|
* Gets the variable object of `arguments` which is defined implicitly.
|
|
113047
|
-
* @param {
|
|
113048
|
-
* @returns {
|
|
113490
|
+
* @param {Scope} scope A scope to get.
|
|
113491
|
+
* @returns {Variable} The found variable object.
|
|
113049
113492
|
*/
|
|
113050
113493
|
function getVariableOfArguments(scope) {
|
|
113051
113494
|
const variables = scope.variables;
|
|
@@ -113468,6 +113911,14 @@ function requirePreferConst () {
|
|
|
113468
113911
|
const FixTracker = requireFixTracker();
|
|
113469
113912
|
const astUtils = requireAstUtils();
|
|
113470
113913
|
|
|
113914
|
+
//------------------------------------------------------------------------------
|
|
113915
|
+
// Types
|
|
113916
|
+
//------------------------------------------------------------------------------
|
|
113917
|
+
|
|
113918
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
113919
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
113920
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
113921
|
+
|
|
113471
113922
|
//------------------------------------------------------------------------------
|
|
113472
113923
|
// Helpers
|
|
113473
113924
|
//------------------------------------------------------------------------------
|
|
@@ -113512,7 +113963,7 @@ function requirePreferConst () {
|
|
|
113512
113963
|
* Checks if an property or element is from outer scope or function parameters
|
|
113513
113964
|
* in destructing pattern.
|
|
113514
113965
|
* @param {string} name A variable name to be checked.
|
|
113515
|
-
* @param {
|
|
113966
|
+
* @param {Scope} initScope A scope to start find.
|
|
113516
113967
|
* @returns {boolean} Indicates if the variable is from outer scope or function parameters.
|
|
113517
113968
|
*/
|
|
113518
113969
|
function isOuterVariableInDestructing(name, initScope) {
|
|
@@ -113538,7 +113989,7 @@ function requirePreferConst () {
|
|
|
113538
113989
|
* belongs to.
|
|
113539
113990
|
* This is used to detect a mix of reassigned and never reassigned in a
|
|
113540
113991
|
* destructuring.
|
|
113541
|
-
* @param {
|
|
113992
|
+
* @param {Reference} reference A reference to get.
|
|
113542
113993
|
* @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
|
|
113543
113994
|
* null.
|
|
113544
113995
|
*/
|
|
@@ -113624,7 +114075,7 @@ function requirePreferConst () {
|
|
|
113624
114075
|
* `/*exported foo` directive comment makes such variables. This rule does not
|
|
113625
114076
|
* warn such variables because this rule cannot distinguish whether the
|
|
113626
114077
|
* exported variables are reassigned or not.
|
|
113627
|
-
* @param {
|
|
114078
|
+
* @param {Variable} variable A variable to get.
|
|
113628
114079
|
* @param {boolean} ignoreReadBeforeAssign
|
|
113629
114080
|
* The value of `ignoreReadBeforeAssign` option.
|
|
113630
114081
|
* @returns {ASTNode|null}
|
|
@@ -113724,7 +114175,7 @@ function requirePreferConst () {
|
|
|
113724
114175
|
* reference of given variables belongs to.
|
|
113725
114176
|
* This is used to detect a mix of reassigned and never reassigned in a
|
|
113726
114177
|
* destructuring.
|
|
113727
|
-
* @param {
|
|
114178
|
+
* @param {Variable[]} variables Variables to group by destructuring.
|
|
113728
114179
|
* @param {boolean} ignoreReadBeforeAssign
|
|
113729
114180
|
* The value of `ignoreReadBeforeAssign` option.
|
|
113730
114181
|
* @returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.
|
|
@@ -113845,7 +114296,7 @@ function requirePreferConst () {
|
|
|
113845
114296
|
* nullable. In simple declaration or assignment cases, the length of
|
|
113846
114297
|
* the array is 1. In destructuring cases, the length of the array can
|
|
113847
114298
|
* be 2 or more.
|
|
113848
|
-
* @param {(
|
|
114299
|
+
* @param {(Reference|null)[]} nodes
|
|
113849
114300
|
* References which are grouped by destructuring to report.
|
|
113850
114301
|
* @returns {void}
|
|
113851
114302
|
*/
|
|
@@ -116387,14 +116838,22 @@ function requirePreferRestParams () {
|
|
|
116387
116838
|
if (hasRequiredPreferRestParams) return preferRestParams;
|
|
116388
116839
|
hasRequiredPreferRestParams = 1;
|
|
116389
116840
|
|
|
116841
|
+
//------------------------------------------------------------------------------
|
|
116842
|
+
// Types
|
|
116843
|
+
//------------------------------------------------------------------------------
|
|
116844
|
+
|
|
116845
|
+
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
116846
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
116847
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
116848
|
+
|
|
116390
116849
|
//------------------------------------------------------------------------------
|
|
116391
116850
|
// Helpers
|
|
116392
116851
|
//------------------------------------------------------------------------------
|
|
116393
116852
|
|
|
116394
116853
|
/**
|
|
116395
116854
|
* Gets the variable object of `arguments` which is defined implicitly.
|
|
116396
|
-
* @param {
|
|
116397
|
-
* @returns {
|
|
116855
|
+
* @param {Scope} scope A scope to get.
|
|
116856
|
+
* @returns {Variable} The found variable object.
|
|
116398
116857
|
*/
|
|
116399
116858
|
function getVariableOfArguments(scope) {
|
|
116400
116859
|
const variables = scope.variables;
|
|
@@ -116422,7 +116881,7 @@ function requirePreferRestParams () {
|
|
|
116422
116881
|
* - arguments[i] .... true // computed member access
|
|
116423
116882
|
* - arguments[0] .... true // computed member access
|
|
116424
116883
|
* - arguments.length .... false // normal member access
|
|
116425
|
-
* @param {
|
|
116884
|
+
* @param {Reference} reference The reference to check.
|
|
116426
116885
|
* @returns {boolean} `true` if the reference is not normal member access.
|
|
116427
116886
|
*/
|
|
116428
116887
|
function isNotNormalMemberAccess(reference) {
|
|
@@ -116463,7 +116922,7 @@ function requirePreferRestParams () {
|
|
|
116463
116922
|
|
|
116464
116923
|
/**
|
|
116465
116924
|
* Reports a given reference.
|
|
116466
|
-
* @param {
|
|
116925
|
+
* @param {Reference} reference A reference to report.
|
|
116467
116926
|
* @returns {void}
|
|
116468
116927
|
*/
|
|
116469
116928
|
function report(reference) {
|
|
@@ -118343,6 +118802,12 @@ function requireRadix () {
|
|
|
118343
118802
|
|
|
118344
118803
|
const astUtils = requireAstUtils();
|
|
118345
118804
|
|
|
118805
|
+
//------------------------------------------------------------------------------
|
|
118806
|
+
// Types
|
|
118807
|
+
//------------------------------------------------------------------------------
|
|
118808
|
+
|
|
118809
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
118810
|
+
|
|
118346
118811
|
//------------------------------------------------------------------------------
|
|
118347
118812
|
// Helpers
|
|
118348
118813
|
//------------------------------------------------------------------------------
|
|
@@ -118353,7 +118818,7 @@ function requireRadix () {
|
|
|
118353
118818
|
|
|
118354
118819
|
/**
|
|
118355
118820
|
* Checks whether a given variable is shadowed or not.
|
|
118356
|
-
* @param {
|
|
118821
|
+
* @param {Variable} variable A variable to check.
|
|
118357
118822
|
* @returns {boolean} `true` if the variable is shadowed.
|
|
118358
118823
|
*/
|
|
118359
118824
|
function isShadowed(variable) {
|