eslint-linter-browserify 9.5.0 → 9.7.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.
Files changed (5) hide show
  1. package/linter.cjs +756 -366
  2. package/linter.js +756 -366
  3. package/linter.min.js +2 -2
  4. package/linter.mjs +756 -366
  5. package/package.json +5 -5
package/linter.cjs CHANGED
@@ -6572,7 +6572,7 @@ function requireEslintScope () {
6572
6572
  this.currentScope().__define(pattern,
6573
6573
  new Definition(
6574
6574
  Variable.CatchClause,
6575
- node.param,
6575
+ pattern,
6576
6576
  node,
6577
6577
  null,
6578
6578
  null,
@@ -6830,7 +6830,7 @@ function requireEslintScope () {
6830
6830
 
6831
6831
  /* vim: set sw=4 ts=4 et tw=80 : */
6832
6832
 
6833
- const version = "8.0.1";
6833
+ const version = "8.0.2";
6834
6834
 
6835
6835
  /*
6836
6836
  Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
@@ -8024,7 +8024,7 @@ function requireAcorn () {
8024
8024
 
8025
8025
  // ## Parser utilities
8026
8026
 
8027
- var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
8027
+ var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/s;
8028
8028
  pp$9.strictDirective = function(start) {
8029
8029
  if (this.options.ecmaVersion < 5) { return false }
8030
8030
  for (;;) {
@@ -8210,7 +8210,7 @@ function requireAcorn () {
8210
8210
  // Statement) is allowed here. If context is not empty then only a Statement
8211
8211
  // is allowed. However, `let [` is an explicit negative lookahead for
8212
8212
  // ExpressionStatement, so special-case it first.
8213
- if (nextCh === 91 || nextCh === 92) { return true } // '[', '/'
8213
+ if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
8214
8214
  if (context) { return false }
8215
8215
 
8216
8216
  if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
@@ -8403,13 +8403,19 @@ function requireAcorn () {
8403
8403
  return this.parseFor(node, init$1)
8404
8404
  }
8405
8405
  var startsWithLet = this.isContextual("let"), isForOf = false;
8406
+ var containsEsc = this.containsEsc;
8406
8407
  var refDestructuringErrors = new DestructuringErrors;
8407
- var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors);
8408
+ var initPos = this.start;
8409
+ var init = awaitAt > -1
8410
+ ? this.parseExprSubscripts(refDestructuringErrors, "await")
8411
+ : this.parseExpression(true, refDestructuringErrors);
8408
8412
  if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
8409
- if (this.options.ecmaVersion >= 9) {
8410
- if (this.type === types$1._in) {
8411
- if (awaitAt > -1) { this.unexpected(awaitAt); }
8412
- } else { node.await = awaitAt > -1; }
8413
+ if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
8414
+ if (this.type === types$1._in) { this.unexpected(awaitAt); }
8415
+ node.await = true;
8416
+ } else if (isForOf && this.options.ecmaVersion >= 8) {
8417
+ if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
8418
+ else if (this.options.ecmaVersion >= 9) { node.await = false; }
8413
8419
  }
8414
8420
  if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
8415
8421
  this.toAssignable(init, false, refDestructuringErrors);
@@ -10022,8 +10028,7 @@ function requireAcorn () {
10022
10028
  node.argument = this.parseMaybeUnary(null, true, update, forInit);
10023
10029
  this.checkExpressionErrors(refDestructuringErrors, true);
10024
10030
  if (update) { this.checkLValSimple(node.argument); }
10025
- else if (this.strict && node.operator === "delete" &&
10026
- node.argument.type === "Identifier")
10031
+ else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
10027
10032
  { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
10028
10033
  else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
10029
10034
  { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
@@ -10058,10 +10063,18 @@ function requireAcorn () {
10058
10063
  }
10059
10064
  };
10060
10065
 
10066
+ function isLocalVariableAccess(node) {
10067
+ return (
10068
+ node.type === "Identifier" ||
10069
+ node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
10070
+ )
10071
+ }
10072
+
10061
10073
  function isPrivateFieldAccess(node) {
10062
10074
  return (
10063
10075
  node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
10064
- node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
10076
+ node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
10077
+ node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
10065
10078
  )
10066
10079
  }
10067
10080
 
@@ -10488,7 +10501,7 @@ function requireAcorn () {
10488
10501
  this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
10489
10502
  }
10490
10503
  elem.value = {
10491
- raw: this.value,
10504
+ raw: this.value.replace(/\r\n?/g, "\n"),
10492
10505
  cooked: null
10493
10506
  };
10494
10507
  } else {
@@ -11163,6 +11176,30 @@ function requireAcorn () {
11163
11176
 
11164
11177
  var pp$1 = Parser.prototype;
11165
11178
 
11179
+ // Track disjunction structure to determine whether a duplicate
11180
+ // capture group name is allowed because it is in a separate branch.
11181
+ var BranchID = function BranchID(parent, base) {
11182
+ // Parent disjunction branch
11183
+ this.parent = parent;
11184
+ // Identifies this set of sibling branches
11185
+ this.base = base || this;
11186
+ };
11187
+
11188
+ BranchID.prototype.separatedFrom = function separatedFrom (alt) {
11189
+ // A branch is separate from another branch if they or any of
11190
+ // their parents are siblings in a given disjunction
11191
+ for (var self = this; self; self = self.parent) {
11192
+ for (var other = alt; other; other = other.parent) {
11193
+ if (self.base === other.base && self !== other) { return true }
11194
+ }
11195
+ }
11196
+ return false
11197
+ };
11198
+
11199
+ BranchID.prototype.sibling = function sibling () {
11200
+ return new BranchID(this.parent, this.base)
11201
+ };
11202
+
11166
11203
  var RegExpValidationState = function RegExpValidationState(parser) {
11167
11204
  this.parser = parser;
11168
11205
  this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
@@ -11179,8 +11216,9 @@ function requireAcorn () {
11179
11216
  this.lastAssertionIsQuantifiable = false;
11180
11217
  this.numCapturingParens = 0;
11181
11218
  this.maxBackReference = 0;
11182
- this.groupNames = [];
11219
+ this.groupNames = Object.create(null);
11183
11220
  this.backReferenceNames = [];
11221
+ this.branchID = null;
11184
11222
  };
11185
11223
 
11186
11224
  RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
@@ -11312,6 +11350,11 @@ function requireAcorn () {
11312
11350
  }
11313
11351
  };
11314
11352
 
11353
+ function hasProp(obj) {
11354
+ for (var _ in obj) { return true }
11355
+ return false
11356
+ }
11357
+
11315
11358
  /**
11316
11359
  * Validate the pattern part of a given RegExpLiteral.
11317
11360
  *
@@ -11326,7 +11369,7 @@ function requireAcorn () {
11326
11369
  // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
11327
11370
  // exception if _P_ did not conform to the grammar, if any elements of _P_
11328
11371
  // were not matched by the parse, or if any Early Error conditions exist.
11329
- if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
11372
+ if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
11330
11373
  state.switchN = true;
11331
11374
  this.regexp_pattern(state);
11332
11375
  }
@@ -11340,8 +11383,9 @@ function requireAcorn () {
11340
11383
  state.lastAssertionIsQuantifiable = false;
11341
11384
  state.numCapturingParens = 0;
11342
11385
  state.maxBackReference = 0;
11343
- state.groupNames.length = 0;
11386
+ state.groupNames = Object.create(null);
11344
11387
  state.backReferenceNames.length = 0;
11388
+ state.branchID = null;
11345
11389
 
11346
11390
  this.regexp_disjunction(state);
11347
11391
 
@@ -11360,7 +11404,7 @@ function requireAcorn () {
11360
11404
  for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
11361
11405
  var name = list[i];
11362
11406
 
11363
- if (state.groupNames.indexOf(name) === -1) {
11407
+ if (!state.groupNames[name]) {
11364
11408
  state.raise("Invalid named capture referenced");
11365
11409
  }
11366
11410
  }
@@ -11368,10 +11412,14 @@ function requireAcorn () {
11368
11412
 
11369
11413
  // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
11370
11414
  pp$1.regexp_disjunction = function(state) {
11415
+ var trackDisjunction = this.options.ecmaVersion >= 16;
11416
+ if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
11371
11417
  this.regexp_alternative(state);
11372
11418
  while (state.eat(0x7C /* | */)) {
11419
+ if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
11373
11420
  this.regexp_alternative(state);
11374
11421
  }
11422
+ if (trackDisjunction) { state.branchID = state.branchID.parent; }
11375
11423
 
11376
11424
  // Make the same message as V8.
11377
11425
  if (this.regexp_eatQuantifier(state, true)) {
@@ -11384,8 +11432,7 @@ function requireAcorn () {
11384
11432
 
11385
11433
  // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
11386
11434
  pp$1.regexp_alternative = function(state) {
11387
- while (state.pos < state.source.length && this.regexp_eatTerm(state))
11388
- { }
11435
+ while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
11389
11436
  };
11390
11437
 
11391
11438
  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
@@ -11623,14 +11670,26 @@ function requireAcorn () {
11623
11670
  // `?` GroupName
11624
11671
  pp$1.regexp_groupSpecifier = function(state) {
11625
11672
  if (state.eat(0x3F /* ? */)) {
11626
- if (this.regexp_eatGroupName(state)) {
11627
- if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
11673
+ if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
11674
+ var trackDisjunction = this.options.ecmaVersion >= 16;
11675
+ var known = state.groupNames[state.lastStringValue];
11676
+ if (known) {
11677
+ if (trackDisjunction) {
11678
+ for (var i = 0, list = known; i < list.length; i += 1) {
11679
+ var altID = list[i];
11680
+
11681
+ if (!altID.separatedFrom(state.branchID))
11682
+ { state.raise("Duplicate capture group name"); }
11683
+ }
11684
+ } else {
11628
11685
  state.raise("Duplicate capture group name");
11629
11686
  }
11630
- state.groupNames.push(state.lastStringValue);
11631
- return
11632
11687
  }
11633
- state.raise("Invalid group");
11688
+ if (trackDisjunction) {
11689
+ (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
11690
+ } else {
11691
+ state.groupNames[state.lastStringValue] = true;
11692
+ }
11634
11693
  }
11635
11694
  };
11636
11695
 
@@ -13135,15 +13194,18 @@ function requireAcorn () {
13135
13194
  break
13136
13195
 
13137
13196
  case "$":
13138
- if (this.input[this.pos + 1] !== "{") {
13139
- break
13140
- }
13141
-
13142
- // falls through
13197
+ if (this.input[this.pos + 1] !== "{") { break }
13198
+ // fall through
13143
13199
  case "`":
13144
13200
  return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))
13145
13201
 
13146
- // no default
13202
+ case "\r":
13203
+ if (this.input[this.pos + 1] === "\n") { ++this.pos; }
13204
+ // fall through
13205
+ case "\n": case "\u2028": case "\u2029":
13206
+ ++this.curLine;
13207
+ this.lineStart = this.pos + 1;
13208
+ break
13147
13209
  }
13148
13210
  }
13149
13211
  this.raise(this.start, "Unterminated template");
@@ -13206,6 +13268,7 @@ function requireAcorn () {
13206
13268
  if (isNewLine(ch)) {
13207
13269
  // Unicode new line characters after \ get removed from output in both
13208
13270
  // template literals and strings
13271
+ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
13209
13272
  return ""
13210
13273
  }
13211
13274
  return String.fromCharCode(ch)
@@ -13284,7 +13347,7 @@ function requireAcorn () {
13284
13347
  // [walk]: util/walk.js
13285
13348
 
13286
13349
 
13287
- var version = "8.11.3";
13350
+ var version = "8.12.0";
13288
13351
 
13289
13352
  Parser.acorn = {
13290
13353
  Parser: Parser,
@@ -14595,7 +14658,7 @@ function requireEspree () {
14595
14658
  */
14596
14659
  function convertTemplatePart(tokens, code) {
14597
14660
  const firstToken = tokens[0],
14598
- lastTemplateToken = tokens[tokens.length - 1];
14661
+ lastTemplateToken = tokens.at(-1);
14599
14662
 
14600
14663
  const token = {
14601
14664
  type: Token.Template,
@@ -14832,7 +14895,8 @@ function requireEspree () {
14832
14895
  12, // 2021
14833
14896
  13, // 2022
14834
14897
  14, // 2023
14835
- 15 // 2024
14898
+ 15, // 2024
14899
+ 16 // 2025
14836
14900
  ];
14837
14901
 
14838
14902
  /**
@@ -14840,7 +14904,7 @@ function requireEspree () {
14840
14904
  * @returns {number} The latest ECMAScript version.
14841
14905
  */
14842
14906
  function getLatestEcmaVersion() {
14843
- return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
14907
+ return SUPPORTED_VERSIONS.at(-1);
14844
14908
  }
14845
14909
 
14846
14910
  /**
@@ -15282,9 +15346,64 @@ function requireEspree () {
15282
15346
  };
15283
15347
  };
15284
15348
 
15285
- const version$1 = "10.0.1";
15349
+ const version$1 = "10.1.0";
15286
15350
 
15287
- /* eslint-disable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */
15351
+ /**
15352
+ * @fileoverview Main Espree file that converts Acorn into Esprima output.
15353
+ *
15354
+ * This file contains code from the following MIT-licensed projects:
15355
+ * 1. Acorn
15356
+ * 2. Babylon
15357
+ * 3. Babel-ESLint
15358
+ *
15359
+ * This file also contains code from Esprima, which is BSD licensed.
15360
+ *
15361
+ * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
15362
+ * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
15363
+ * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
15364
+ *
15365
+ * Redistribution and use in source and binary forms, with or without
15366
+ * modification, are permitted provided that the following conditions are met:
15367
+ *
15368
+ * * Redistributions of source code must retain the above copyright
15369
+ * notice, this list of conditions and the following disclaimer.
15370
+ * * Redistributions in binary form must reproduce the above copyright
15371
+ * notice, this list of conditions and the following disclaimer in the
15372
+ * documentation and/or other materials provided with the distribution.
15373
+ *
15374
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15375
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15376
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15377
+ * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
15378
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
15379
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
15380
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
15381
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15382
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
15383
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15384
+ *
15385
+ * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
15386
+ *
15387
+ * Redistribution and use in source and binary forms, with or without
15388
+ * modification, are permitted provided that the following conditions are met:
15389
+ *
15390
+ * * Redistributions of source code must retain the above copyright
15391
+ * notice, this list of conditions and the following disclaimer.
15392
+ * * Redistributions in binary form must reproduce the above copyright
15393
+ * notice, this list of conditions and the following disclaimer in the
15394
+ * documentation and/or other materials provided with the distribution.
15395
+ *
15396
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15397
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15398
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15399
+ * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
15400
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
15401
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
15402
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
15403
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15404
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
15405
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15406
+ */
15288
15407
 
15289
15408
 
15290
15409
  // To initialize lazily.
@@ -15380,7 +15499,7 @@ function requireEspree () {
15380
15499
  }
15381
15500
 
15382
15501
  for (key in VisitorKeys) {
15383
- if (Object.hasOwnProperty.call(VisitorKeys, key)) {
15502
+ if (Object.hasOwn(VisitorKeys, key)) {
15384
15503
  types[key] = key;
15385
15504
  }
15386
15505
  }
@@ -17382,7 +17501,7 @@ function requireLodash_merge () {
17382
17501
  }
17383
17502
 
17384
17503
  var name = "eslint";
17385
- var version = "9.5.0";
17504
+ var version = "9.7.0";
17386
17505
  var author = "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>";
17387
17506
  var description$2 = "An AST-based pattern checker for JavaScript.";
17388
17507
  var bin = {
@@ -17435,10 +17554,10 @@ var homepage = "https://eslint.org";
17435
17554
  var bugs = "https://github.com/eslint/eslint/issues/";
17436
17555
  var dependencies$2 = {
17437
17556
  "@eslint-community/eslint-utils": "^4.2.0",
17438
- "@eslint-community/regexpp": "^4.6.1",
17439
- "@eslint/config-array": "^0.16.0",
17557
+ "@eslint-community/regexpp": "^4.11.0",
17558
+ "@eslint/config-array": "^0.17.0",
17440
17559
  "@eslint/eslintrc": "^3.1.0",
17441
- "@eslint/js": "9.5.0",
17560
+ "@eslint/js": "9.7.0",
17442
17561
  "@humanwhocodes/module-importer": "^1.0.1",
17443
17562
  "@humanwhocodes/retry": "^0.3.0",
17444
17563
  "@nodelib/fs.walk": "^1.2.8",
@@ -17447,9 +17566,9 @@ var dependencies$2 = {
17447
17566
  "cross-spawn": "^7.0.2",
17448
17567
  debug: "^4.3.2",
17449
17568
  "escape-string-regexp": "^4.0.0",
17450
- "eslint-scope": "^8.0.1",
17569
+ "eslint-scope": "^8.0.2",
17451
17570
  "eslint-visitor-keys": "^4.0.0",
17452
- espree: "^10.0.1",
17571
+ espree: "^10.1.0",
17453
17572
  esquery: "^1.5.0",
17454
17573
  esutils: "^2.0.2",
17455
17574
  "fast-deep-equal": "^3.1.3",
@@ -17472,13 +17591,12 @@ var dependencies$2 = {
17472
17591
  var devDependencies = {
17473
17592
  "@babel/core": "^7.4.3",
17474
17593
  "@babel/preset-env": "^7.4.3",
17475
- "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
17594
+ "@eslint/core": "^0.1.0",
17476
17595
  "@types/estree": "^1.0.5",
17477
17596
  "@types/node": "^20.11.5",
17478
17597
  "@wdio/browser-runner": "^8.38.3",
17479
17598
  "@wdio/cli": "^8.38.2",
17480
17599
  "@wdio/concise-reporter": "^8.38.2",
17481
- "@wdio/globals": "^8.38.2",
17482
17600
  "@wdio/mocha-framework": "^8.38.2",
17483
17601
  "babel-loader": "^8.0.5",
17484
17602
  c8: "^7.12.0",
@@ -17490,11 +17608,8 @@ var devDependencies = {
17490
17608
  eslint: "file:.",
17491
17609
  "eslint-config-eslint": "file:packages/eslint-config-eslint",
17492
17610
  "eslint-plugin-eslint-plugin": "^6.0.0",
17493
- "eslint-plugin-internal-rules": "file:tools/internal-rules",
17494
- "eslint-plugin-jsdoc": "^48.2.3",
17495
- "eslint-plugin-n": "^17.2.0",
17496
- "eslint-plugin-unicorn": "^52.0.0",
17497
17611
  "eslint-release": "^3.2.2",
17612
+ "eslint-rule-composer": "^0.3.0",
17498
17613
  eslump: "^3.0.0",
17499
17614
  esprima: "^4.0.1",
17500
17615
  "fast-glob": "^3.2.11",
@@ -17504,7 +17619,7 @@ var devDependencies = {
17504
17619
  got: "^11.8.3",
17505
17620
  "gray-matter": "^4.0.3",
17506
17621
  "js-yaml": "^4.1.0",
17507
- knip: "^5.8.0",
17622
+ knip: "^5.21.0",
17508
17623
  "lint-staged": "^11.0.0",
17509
17624
  "load-perf": "^0.2.0",
17510
17625
  "markdown-it": "^12.2.0",
@@ -33556,6 +33671,10 @@ function requireGlobals () {
33556
33671
  ...es2023
33557
33672
  };
33558
33673
 
33674
+ const es2025 = {
33675
+ ...es2024
33676
+ };
33677
+
33559
33678
 
33560
33679
  //-----------------------------------------------------------------------------
33561
33680
  // Exports
@@ -33574,7 +33693,8 @@ function requireGlobals () {
33574
33693
  es2021,
33575
33694
  es2022,
33576
33695
  es2023,
33577
- es2024
33696
+ es2024,
33697
+ es2025
33578
33698
  };
33579
33699
  return globals;
33580
33700
  }
@@ -40371,12 +40491,6 @@ function requireConfigCommentParser () {
40371
40491
 
40372
40492
  const debug = requireSrc()("eslint:config-comment-parser");
40373
40493
 
40374
- //------------------------------------------------------------------------------
40375
- // Typedefs
40376
- //------------------------------------------------------------------------------
40377
-
40378
- /** @typedef {import("../shared/types").LintMessage} LintMessage */
40379
-
40380
40494
  //------------------------------------------------------------------------------
40381
40495
  // Public Interface
40382
40496
  //------------------------------------------------------------------------------
@@ -40418,10 +40532,9 @@ function requireConfigCommentParser () {
40418
40532
  /**
40419
40533
  * Parses a JSON-like config.
40420
40534
  * @param {string} string The string to parse.
40421
- * @param {Object} location Start line and column of comments for potential error message.
40422
- * @returns {({success: true, config: Object}|{success: false, error: LintMessage})} Result map object
40535
+ * @returns {({success: true, config: Object}|{success: false, error: {message: string}})} Result map object
40423
40536
  */
40424
- parseJsonConfig(string, location) {
40537
+ parseJsonConfig(string) {
40425
40538
  debug("Parsing JSON config");
40426
40539
 
40427
40540
  // Parses a JSON-like comment by the same way as parsing CLI option.
@@ -40464,13 +40577,7 @@ function requireConfigCommentParser () {
40464
40577
  return {
40465
40578
  success: false,
40466
40579
  error: {
40467
- ruleId: null,
40468
- fatal: true,
40469
- severity: 2,
40470
- message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`,
40471
- line: location.start.line,
40472
- column: location.start.column + 1,
40473
- nodeType: null
40580
+ message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`
40474
40581
  }
40475
40582
  };
40476
40583
 
@@ -40569,6 +40676,10 @@ function requireSourceCode$1 () {
40569
40676
  //------------------------------------------------------------------------------
40570
40677
 
40571
40678
  /** @typedef {import("eslint-scope").Variable} Variable */
40679
+ /** @typedef {import("eslint-scope").Scope} Scope */
40680
+ /** @typedef {import("@eslint/core").SourceCode} ISourceCode */
40681
+ /** @typedef {import("@eslint/core").Directive} IDirective */
40682
+ /** @typedef {import("@eslint/core").TraversalStep} ITraversalStep */
40572
40683
 
40573
40684
  //------------------------------------------------------------------------------
40574
40685
  // Private
@@ -40913,6 +41024,7 @@ function requireSourceCode$1 () {
40913
41024
 
40914
41025
  /**
40915
41026
  * A class to represent a directive comment.
41027
+ * @implements {IDirective}
40916
41028
  */
40917
41029
  class Directive {
40918
41030
 
@@ -40969,12 +41081,13 @@ function requireSourceCode$1 () {
40969
41081
 
40970
41082
  /**
40971
41083
  * Represents parsed source code.
41084
+ * @implements {ISourceCode}
40972
41085
  */
40973
41086
  class SourceCode extends TokenStore {
40974
41087
 
40975
41088
  /**
40976
41089
  * The cache of steps that were taken while traversing the source code.
40977
- * @type {Array<TraversalStep>}
41090
+ * @type {Array<ITraversalStep>}
40978
41091
  */
40979
41092
  #steps;
40980
41093
 
@@ -41378,7 +41491,7 @@ function requireSourceCode$1 () {
41378
41491
  /**
41379
41492
  * Gets the scope for the given node
41380
41493
  * @param {ASTNode} currentNode The node to get the scope of
41381
- * @returns {eslint-scope.Scope} The scope information for this node
41494
+ * @returns {Scope} The scope information for this node
41382
41495
  * @throws {TypeError} If the `currentNode` argument is missing.
41383
41496
  */
41384
41497
  getScope(currentNode) {
@@ -41639,7 +41752,7 @@ function requireSourceCode$1 () {
41639
41752
  /**
41640
41753
  * Applies configuration found inside of the source code. This method is only
41641
41754
  * called when ESLint is running with inline configuration allowed.
41642
- * @returns {{problems:Array<Problem>,configs:{config:FlatConfigArray,node:ASTNode}}} Information
41755
+ * @returns {{problems:Array<Problem>,configs:{config:FlatConfigArray,loc:Location}}} Information
41643
41756
  * that ESLint needs to further process the inline configuration.
41644
41757
  */
41645
41758
  applyInlineConfig() {
@@ -41687,17 +41800,21 @@ function requireSourceCode$1 () {
41687
41800
  break;
41688
41801
 
41689
41802
  case "eslint": {
41690
- const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc);
41803
+ const parseResult = commentParser.parseJsonConfig(directiveValue);
41691
41804
 
41692
41805
  if (parseResult.success) {
41693
41806
  configs.push({
41694
41807
  config: {
41695
41808
  rules: parseResult.config
41696
41809
  },
41697
- node: comment
41810
+ loc: comment.loc
41698
41811
  });
41699
41812
  } else {
41700
- problems.push(parseResult.error);
41813
+ problems.push({
41814
+ ruleId: null,
41815
+ loc: comment.loc,
41816
+ message: parseResult.error.message
41817
+ });
41701
41818
  }
41702
41819
 
41703
41820
  break;
@@ -41883,6 +42000,9 @@ function requireApplyDisableDirectives () {
41883
42000
  //------------------------------------------------------------------------------
41884
42001
 
41885
42002
  /** @typedef {import("../shared/types").LintMessage} LintMessage */
42003
+ /** @typedef {import("@eslint/core").Language} Language */
42004
+ /** @typedef {import("@eslint/core").Position} Position */
42005
+ /** @typedef {import("@eslint/core").RulesConfig} RulesConfig */
41886
42006
 
41887
42007
  //------------------------------------------------------------------------------
41888
42008
  // Module Definition
@@ -41897,8 +42017,8 @@ function requireApplyDisableDirectives () {
41897
42017
 
41898
42018
  /**
41899
42019
  * Compares the locations of two objects in a source file
41900
- * @param {{line: number, column: number}} itemA The first object
41901
- * @param {{line: number, column: number}} itemB The second object
42020
+ * @param {Position} itemA The first object
42021
+ * @param {Position} itemB The second object
41902
42022
  * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
41903
42023
  * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
41904
42024
  */
@@ -42291,7 +42411,7 @@ function requireApplyDisableDirectives () {
42291
42411
  * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems
42292
42412
  * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns.
42293
42413
  * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives
42294
- * @param {Object} options.configuredRules The rules configuration.
42414
+ * @param {RulesConfig} options.configuredRules The rules configuration.
42295
42415
  * @param {Function} options.ruleFilter A predicate function to filter which rules should be executed.
42296
42416
  * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties.
42297
42417
  * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]}
@@ -42715,10 +42835,8 @@ function requireNodeEventGenerator () {
42715
42835
  * @returns {void}
42716
42836
  */
42717
42837
  enterNode(node) {
42718
- if (node.parent) {
42719
- this.currentAncestry.unshift(node.parent);
42720
- }
42721
42838
  this.applySelectors(node, false);
42839
+ this.currentAncestry.unshift(node);
42722
42840
  }
42723
42841
 
42724
42842
  /**
@@ -42727,8 +42845,8 @@ function requireNodeEventGenerator () {
42727
42845
  * @returns {void}
42728
42846
  */
42729
42847
  leaveNode(node) {
42730
- this.applySelectors(node, true);
42731
42848
  this.currentAncestry.shift();
42849
+ this.applySelectors(node, true);
42732
42850
  }
42733
42851
  }
42734
42852
 
@@ -43985,7 +44103,7 @@ function requireEcmaVersion () {
43985
44103
  * The latest ECMAScript version supported by ESLint.
43986
44104
  * @type {number} year-based ECMAScript version
43987
44105
  */
43988
- const LATEST_ECMA_VERSION = 2024;
44106
+ const LATEST_ECMA_VERSION = 2025;
43989
44107
 
43990
44108
  ecmaVersion = {
43991
44109
  LATEST_ECMA_VERSION
@@ -69379,7 +69497,7 @@ function requireRegexpp () {
69379
69497
  __proto__: null
69380
69498
  });
69381
69499
 
69382
- const latestEcmaVersion = 2024;
69500
+ const latestEcmaVersion = 2025;
69383
69501
 
69384
69502
  let largeIdStartRanges = undefined;
69385
69503
  let largeIdContinueRanges = undefined;
@@ -69418,10 +69536,10 @@ function requireRegexpp () {
69418
69536
  return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges()));
69419
69537
  }
69420
69538
  function initLargeIdStartRanges() {
69421
- return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1r 6 1 2 0 2 4 p f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 1w 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 33u g6 6nu fs 8 u i 26 i t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r l1 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk 2e8 f1 15v 3t6 6 38f");
69539
+ return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1r 6 1 2 0 2 4 p f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 1w 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 33u g6 6nu fs 8 u i 26 i t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r l1 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk g h9 1wj f1 15v 3t6 6 38f");
69422
69540
  }
69423
69541
  function initLargeIdContinueRanges() {
69424
- return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1p 7 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 29 2 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e 9 44n 0 7 e aob 9 2f 9 13 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 3mq 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d rb 6 32 6 6 9 3o7 9 gvt3 6n");
69542
+ return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1p 7 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 29 2 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e 9 44n 0 7 e aob 9 2f 9 13 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 3mq 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d rb 6 32 6 6 9 3o7 9 gvt3 6n");
69425
69543
  }
69426
69544
  function isInRange(cp, ranges) {
69427
69545
  let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
@@ -69447,7 +69565,7 @@ function requireRegexpp () {
69447
69565
  }
69448
69566
 
69449
69567
  class DataSet {
69450
- constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024) {
69568
+ constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025) {
69451
69569
  this._raw2018 = raw2018;
69452
69570
  this._raw2019 = raw2019;
69453
69571
  this._raw2020 = raw2020;
@@ -69455,6 +69573,7 @@ function requireRegexpp () {
69455
69573
  this._raw2022 = raw2022;
69456
69574
  this._raw2023 = raw2023;
69457
69575
  this._raw2024 = raw2024;
69576
+ this._raw2025 = raw2025;
69458
69577
  }
69459
69578
  get es2018() {
69460
69579
  var _a;
@@ -69484,12 +69603,17 @@ function requireRegexpp () {
69484
69603
  var _a;
69485
69604
  return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" "))));
69486
69605
  }
69606
+ get es2025() {
69607
+ var _a;
69608
+ return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" "))));
69609
+ }
69487
69610
  }
69488
69611
  const gcNameSet = new Set(["General_Category", "gc"]);
69489
69612
  const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
69490
- const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "");
69491
- const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz", "");
69492
- const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "");
69613
+ const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", "");
69614
+ const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz", "", "");
69615
+ const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", "");
69616
+ const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", "");
69493
69617
  function isValidUnicodeProperty(version, name, value) {
69494
69618
  if (gcNameSet.has(name)) {
69495
69619
  return version >= 2018 && gcValueSets.es2018.has(value);
@@ -69509,6 +69633,9 @@ function requireRegexpp () {
69509
69633
  (version >= 2019 && binPropertySets.es2019.has(value)) ||
69510
69634
  (version >= 2021 && binPropertySets.es2021.has(value)));
69511
69635
  }
69636
+ function isValidLoneUnicodePropertyOfString(version, value) {
69637
+ return version >= 2024 && binPropertyOfStringsSets.es2024.has(value);
69638
+ }
69512
69639
 
69513
69640
  const BACKSPACE = 0x08;
69514
69641
  const CHARACTER_TABULATION = 0x09;
@@ -69628,6 +69755,103 @@ function requireRegexpp () {
69628
69755
  return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
69629
69756
  }
69630
69757
 
69758
+ class GroupSpecifiersAsES2018 {
69759
+ constructor() {
69760
+ this.groupName = new Set();
69761
+ }
69762
+ clear() {
69763
+ this.groupName.clear();
69764
+ }
69765
+ isEmpty() {
69766
+ return !this.groupName.size;
69767
+ }
69768
+ hasInPattern(name) {
69769
+ return this.groupName.has(name);
69770
+ }
69771
+ hasInScope(name) {
69772
+ return this.hasInPattern(name);
69773
+ }
69774
+ addToScope(name) {
69775
+ this.groupName.add(name);
69776
+ }
69777
+ enterDisjunction() {
69778
+ }
69779
+ enterAlternative() {
69780
+ }
69781
+ leaveDisjunction() {
69782
+ }
69783
+ }
69784
+ class BranchID {
69785
+ constructor(parent, base) {
69786
+ this.parent = parent;
69787
+ this.base = base !== null && base !== void 0 ? base : this;
69788
+ }
69789
+ separatedFrom(other) {
69790
+ var _a, _b;
69791
+ if (this.base === other.base && this !== other) {
69792
+ return true;
69793
+ }
69794
+ if (other.parent && this.separatedFrom(other.parent)) {
69795
+ return true;
69796
+ }
69797
+ return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false;
69798
+ }
69799
+ child() {
69800
+ return new BranchID(this, null);
69801
+ }
69802
+ sibling() {
69803
+ return new BranchID(this.parent, this.base);
69804
+ }
69805
+ }
69806
+ class GroupSpecifiersAsES2025 {
69807
+ constructor() {
69808
+ this.branchID = new BranchID(null, null);
69809
+ this.groupNames = new Map();
69810
+ }
69811
+ clear() {
69812
+ this.branchID = new BranchID(null, null);
69813
+ this.groupNames.clear();
69814
+ }
69815
+ isEmpty() {
69816
+ return !this.groupNames.size;
69817
+ }
69818
+ enterDisjunction() {
69819
+ this.branchID = this.branchID.child();
69820
+ }
69821
+ enterAlternative(index) {
69822
+ if (index === 0) {
69823
+ return;
69824
+ }
69825
+ this.branchID = this.branchID.sibling();
69826
+ }
69827
+ leaveDisjunction() {
69828
+ this.branchID = this.branchID.parent;
69829
+ }
69830
+ hasInPattern(name) {
69831
+ return this.groupNames.has(name);
69832
+ }
69833
+ hasInScope(name) {
69834
+ const branches = this.groupNames.get(name);
69835
+ if (!branches) {
69836
+ return false;
69837
+ }
69838
+ for (const branch of branches) {
69839
+ if (!branch.separatedFrom(this.branchID)) {
69840
+ return true;
69841
+ }
69842
+ }
69843
+ return false;
69844
+ }
69845
+ addToScope(name) {
69846
+ const branches = this.groupNames.get(name);
69847
+ if (branches) {
69848
+ branches.push(this.branchID);
69849
+ return;
69850
+ }
69851
+ this.groupNames.set(name, [this.branchID]);
69852
+ }
69853
+ }
69854
+
69631
69855
  const legacyImpl = {
69632
69856
  at(s, end, i) {
69633
69857
  return i < end ? s.charCodeAt(i) : -1;
@@ -69733,35 +69957,25 @@ function requireRegexpp () {
69733
69957
  }
69734
69958
 
69735
69959
  class RegExpSyntaxError extends SyntaxError {
69736
- constructor(srcCtx, flags, index, message) {
69737
- let source = "";
69738
- if (srcCtx.kind === "literal") {
69739
- const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end);
69740
- if (literal) {
69741
- source = `: ${literal}`;
69742
- }
69743
- }
69744
- else if (srcCtx.kind === "pattern") {
69745
- const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end);
69746
- const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`;
69747
- source = `: /${pattern}/${flagsText}`;
69748
- }
69749
- super(`Invalid regular expression${source}: ${message}`);
69960
+ constructor(message, index) {
69961
+ super(message);
69750
69962
  this.index = index;
69751
69963
  }
69752
69964
  }
69753
-
69754
- const binPropertyOfStringSets = new Set([
69755
- "Basic_Emoji",
69756
- "Emoji_Keycap_Sequence",
69757
- "RGI_Emoji_Modifier_Sequence",
69758
- "RGI_Emoji_Flag_Sequence",
69759
- "RGI_Emoji_Tag_Sequence",
69760
- "RGI_Emoji_ZWJ_Sequence",
69761
- "RGI_Emoji",
69762
- ]);
69763
- function isValidLoneUnicodePropertyOfString(version, value) {
69764
- return version >= 2024 && binPropertyOfStringSets.has(value);
69965
+ function newRegExpSyntaxError(srcCtx, flags, index, message) {
69966
+ let source = "";
69967
+ if (srcCtx.kind === "literal") {
69968
+ const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end);
69969
+ if (literal) {
69970
+ source = `: ${literal}`;
69971
+ }
69972
+ }
69973
+ else if (srcCtx.kind === "pattern") {
69974
+ const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end);
69975
+ const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`;
69976
+ source = `: /${pattern}/${flagsText}`;
69977
+ }
69978
+ return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index);
69765
69979
  }
69766
69980
 
69767
69981
  const SYNTAX_CHARACTER = new Set([
@@ -69870,10 +70084,13 @@ function requireRegexpp () {
69870
70084
  this._lastStrValue = "";
69871
70085
  this._lastAssertionIsQuantifiable = false;
69872
70086
  this._numCapturingParens = 0;
69873
- this._groupNames = new Set();
69874
70087
  this._backreferenceNames = new Set();
69875
70088
  this._srcCtx = null;
69876
70089
  this._options = options !== null && options !== void 0 ? options : {};
70090
+ this._groupSpecifiers =
70091
+ this.ecmaVersion >= 2025
70092
+ ? new GroupSpecifiersAsES2025()
70093
+ : new GroupSpecifiersAsES2018();
69877
70094
  }
69878
70095
  validateLiteral(source, start = 0, end = source.length) {
69879
70096
  this._srcCtx = { source, start, end, kind: "literal" };
@@ -69916,7 +70133,7 @@ function requireRegexpp () {
69916
70133
  this.consumePattern();
69917
70134
  if (!this._nFlag &&
69918
70135
  this.ecmaVersion >= 2018 &&
69919
- this._groupNames.size > 0) {
70136
+ !this._groupSpecifiers.isEmpty()) {
69920
70137
  this._nFlag = true;
69921
70138
  this.rewind(start);
69922
70139
  this.consumePattern();
@@ -70215,7 +70432,7 @@ function requireRegexpp () {
70215
70432
  }
70216
70433
  raise(message, context) {
70217
70434
  var _a, _b, _c;
70218
- throw new RegExpSyntaxError(this._srcCtx, {
70435
+ throw newRegExpSyntaxError(this._srcCtx, {
70219
70436
  unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode),
70220
70437
  unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode,
70221
70438
  }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message);
@@ -70253,7 +70470,7 @@ function requireRegexpp () {
70253
70470
  consumePattern() {
70254
70471
  const start = this.index;
70255
70472
  this._numCapturingParens = this.countCapturingParens();
70256
- this._groupNames.clear();
70473
+ this._groupSpecifiers.clear();
70257
70474
  this._backreferenceNames.clear();
70258
70475
  this.onPatternEnter(start);
70259
70476
  this.consumeDisjunction();
@@ -70272,7 +70489,7 @@ function requireRegexpp () {
70272
70489
  this.raise(`Unexpected character '${c}'`);
70273
70490
  }
70274
70491
  for (const name of this._backreferenceNames) {
70275
- if (!this._groupNames.has(name)) {
70492
+ if (!this._groupSpecifiers.hasInPattern(name)) {
70276
70493
  this.raise("Invalid named capture referenced");
70277
70494
  }
70278
70495
  }
@@ -70313,6 +70530,7 @@ function requireRegexpp () {
70313
70530
  consumeDisjunction() {
70314
70531
  const start = this.index;
70315
70532
  let i = 0;
70533
+ this._groupSpecifiers.enterDisjunction();
70316
70534
  this.onDisjunctionEnter(start);
70317
70535
  do {
70318
70536
  this.consumeAlternative(i++);
@@ -70324,9 +70542,11 @@ function requireRegexpp () {
70324
70542
  this.raise("Lone quantifier brackets");
70325
70543
  }
70326
70544
  this.onDisjunctionLeave(start, this.index);
70545
+ this._groupSpecifiers.leaveDisjunction();
70327
70546
  }
70328
70547
  consumeAlternative(i) {
70329
70548
  const start = this.index;
70549
+ this._groupSpecifiers.enterAlternative(i);
70330
70550
  this.onAlternativeEnter(start, i);
70331
70551
  while (this.currentCodePoint !== -1 && this.consumeTerm()) {
70332
70552
  }
@@ -70560,8 +70780,8 @@ function requireRegexpp () {
70560
70780
  consumeGroupSpecifier() {
70561
70781
  if (this.eat(QUESTION_MARK)) {
70562
70782
  if (this.eatGroupName()) {
70563
- if (!this._groupNames.has(this._lastStrValue)) {
70564
- this._groupNames.add(this._lastStrValue);
70783
+ if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
70784
+ this._groupSpecifiers.addToScope(this._lastStrValue);
70565
70785
  return true;
70566
70786
  }
70567
70787
  this.raise("Duplicate capture group name");
@@ -71330,7 +71550,7 @@ function requireRegexpp () {
71330
71550
  constructor(options) {
71331
71551
  var _a;
71332
71552
  this._node = DUMMY_PATTERN;
71333
- this._expressionBuffer = null;
71553
+ this._expressionBufferMap = new Map();
71334
71554
  this._flags = DUMMY_FLAGS;
71335
71555
  this._backreferences = [];
71336
71556
  this._capturingGroups = [];
@@ -71384,11 +71604,21 @@ function requireRegexpp () {
71384
71604
  this._node.raw = this.source.slice(start, end);
71385
71605
  for (const reference of this._backreferences) {
71386
71606
  const ref = reference.ref;
71387
- const group = typeof ref === "number"
71388
- ? this._capturingGroups[ref - 1]
71389
- : this._capturingGroups.find((g) => g.name === ref);
71390
- reference.resolved = group;
71391
- group.references.push(reference);
71607
+ const groups = typeof ref === "number"
71608
+ ? [this._capturingGroups[ref - 1]]
71609
+ : this._capturingGroups.filter((g) => g.name === ref);
71610
+ if (groups.length === 1) {
71611
+ const group = groups[0];
71612
+ reference.ambiguous = false;
71613
+ reference.resolved = group;
71614
+ }
71615
+ else {
71616
+ reference.ambiguous = true;
71617
+ reference.resolved = groups;
71618
+ }
71619
+ for (const group of groups) {
71620
+ group.references.push(reference);
71621
+ }
71392
71622
  }
71393
71623
  }
71394
71624
  onAlternativeEnter(start) {
@@ -71581,25 +71811,30 @@ function requireRegexpp () {
71581
71811
  }
71582
71812
  onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
71583
71813
  const parent = this._node;
71584
- if ((parent.type !== "Alternative" &&
71585
- parent.type !== "CharacterClass") ||
71586
- (strings && (negate || value))) {
71814
+ if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
71587
71815
  throw new Error("UnknownError");
71588
71816
  }
71589
71817
  const base = {
71590
71818
  type: "CharacterSet",
71591
- parent,
71819
+ parent: null,
71592
71820
  start,
71593
71821
  end,
71594
71822
  raw: this.source.slice(start, end),
71595
71823
  kind,
71596
- strings,
71824
+ strings: null,
71597
71825
  key,
71598
71826
  };
71599
- const node = strings
71600
- ? Object.assign(Object.assign({}, base), { value: null, negate: false, strings: true }) : Object.assign(Object.assign({}, base), { value,
71601
- negate, strings: false });
71602
- parent.elements.push(node);
71827
+ if (strings) {
71828
+ if ((parent.type === "CharacterClass" && !parent.unicodeSets) ||
71829
+ negate ||
71830
+ value !== null) {
71831
+ throw new Error("UnknownError");
71832
+ }
71833
+ parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
71834
+ }
71835
+ else {
71836
+ parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
71837
+ }
71603
71838
  }
71604
71839
  onCharacter(start, end, value) {
71605
71840
  const parent = this._node;
@@ -71629,6 +71864,7 @@ function requireRegexpp () {
71629
71864
  end,
71630
71865
  raw: this.source.slice(start, end),
71631
71866
  ref,
71867
+ ambiguous: false,
71632
71868
  resolved: DUMMY_CAPTURING_GROUP,
71633
71869
  };
71634
71870
  parent.elements.push(node);
@@ -71667,19 +71903,21 @@ function requireRegexpp () {
71667
71903
  const node = this._node;
71668
71904
  if (node.type !== "CharacterClass" ||
71669
71905
  (node.parent.type !== "Alternative" &&
71670
- node.parent.type !== "CharacterClass") ||
71671
- (this._expressionBuffer && node.elements.length > 0)) {
71906
+ node.parent.type !== "CharacterClass")) {
71672
71907
  throw new Error("UnknownError");
71673
71908
  }
71674
71909
  const parent = node.parent;
71675
71910
  node.end = end;
71676
71911
  node.raw = this.source.slice(start, end);
71677
71912
  this._node = parent;
71678
- const expression = this._expressionBuffer;
71679
- this._expressionBuffer = null;
71913
+ const expression = this._expressionBufferMap.get(node);
71680
71914
  if (!expression) {
71681
71915
  return;
71682
71916
  }
71917
+ if (node.elements.length > 0) {
71918
+ throw new Error("UnknownError");
71919
+ }
71920
+ this._expressionBufferMap.delete(node);
71683
71921
  const newNode = {
71684
71922
  type: "ExpressionCharacterClass",
71685
71923
  parent,
@@ -71737,7 +71975,7 @@ function requireRegexpp () {
71737
71975
  throw new Error("UnknownError");
71738
71976
  }
71739
71977
  const right = parent.elements.pop();
71740
- const left = (_a = this._expressionBuffer) !== null && _a !== void 0 ? _a : parent.elements.pop();
71978
+ const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
71741
71979
  if (!left ||
71742
71980
  !right ||
71743
71981
  left.type === "ClassSubtraction" ||
@@ -71756,7 +71994,7 @@ function requireRegexpp () {
71756
71994
  };
71757
71995
  left.parent = node;
71758
71996
  right.parent = node;
71759
- this._expressionBuffer = node;
71997
+ this._expressionBufferMap.set(parent, node);
71760
71998
  }
71761
71999
  onClassSubtraction(start, end) {
71762
72000
  var _a;
@@ -71765,7 +72003,7 @@ function requireRegexpp () {
71765
72003
  throw new Error("UnknownError");
71766
72004
  }
71767
72005
  const right = parent.elements.pop();
71768
- const left = (_a = this._expressionBuffer) !== null && _a !== void 0 ? _a : parent.elements.pop();
72006
+ const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
71769
72007
  if (!left ||
71770
72008
  !right ||
71771
72009
  left.type === "ClassIntersection" ||
@@ -71784,7 +72022,7 @@ function requireRegexpp () {
71784
72022
  };
71785
72023
  left.parent = node;
71786
72024
  right.parent = node;
71787
- this._expressionBuffer = node;
72025
+ this._expressionBufferMap.set(parent, node);
71788
72026
  }
71789
72027
  onClassStringDisjunctionEnter(start) {
71790
72028
  const parent = this._node;
@@ -72113,6 +72351,7 @@ function requireRegexpp () {
72113
72351
 
72114
72352
  regexpp.AST = ast;
72115
72353
  regexpp.RegExpParser = RegExpParser;
72354
+ regexpp.RegExpSyntaxError = RegExpSyntaxError;
72116
72355
  regexpp.RegExpValidator = RegExpValidator;
72117
72356
  regexpp.parseRegExpLiteral = parseRegExpLiteral;
72118
72357
  regexpp.validateRegExpLiteral = validateRegExpLiteral;
@@ -80942,7 +81181,7 @@ function requireRegularExpressions () {
80942
81181
 
80943
81182
  const { RegExpValidator } = requireRegexpp();
80944
81183
 
80945
- const REGEXPP_LATEST_ECMA_VERSION = 2024;
81184
+ const REGEXPP_LATEST_ECMA_VERSION = 2025;
80946
81185
 
80947
81186
  /**
80948
81187
  * Checks if the given regular expression pattern would be valid with the `u` flag.
@@ -86639,6 +86878,9 @@ function requireNoRestrictedImports () {
86639
86878
  minItems: 1,
86640
86879
  uniqueItems: true
86641
86880
  },
86881
+ regex: {
86882
+ type: "string"
86883
+ },
86642
86884
  importNamePattern: {
86643
86885
  type: "string"
86644
86886
  },
@@ -86654,7 +86896,6 @@ function requireNoRestrictedImports () {
86654
86896
  }
86655
86897
  },
86656
86898
  additionalProperties: false,
86657
- required: ["group"],
86658
86899
  not: {
86659
86900
  anyOf: [
86660
86901
  { required: ["importNames", "allowImportNames"] },
@@ -86663,7 +86904,11 @@ function requireNoRestrictedImports () {
86663
86904
  { required: ["importNamePattern", "allowImportNames"] },
86664
86905
  { required: ["allowImportNames", "allowImportNamePattern"] }
86665
86906
  ]
86666
- }
86907
+ },
86908
+ oneOf: [
86909
+ { required: ["group"] },
86910
+ { required: ["regex"] }
86911
+ ]
86667
86912
  },
86668
86913
  uniqueItems: true
86669
86914
  }
@@ -86785,9 +87030,10 @@ function requireNoRestrictedImports () {
86785
87030
 
86786
87031
  // relative paths are supported for this rule
86787
87032
  const restrictedPatternGroups = restrictedPatterns.map(
86788
- ({ group, message, caseSensitive, importNames, importNamePattern, allowImportNames, allowImportNamePattern }) => (
87033
+ ({ group, regex, message, caseSensitive, importNames, importNamePattern, allowImportNames, allowImportNamePattern }) => (
86789
87034
  {
86790
- matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group),
87035
+ ...(group ? { matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group) } : {}),
87036
+ ...(typeof regex === "string" ? { regexMatcher: new RegExp(regex, caseSensitive ? "u" : "iu") } : {}),
86791
87037
  customMessage: message,
86792
87038
  importNames,
86793
87039
  importNamePattern,
@@ -87043,7 +87289,7 @@ function requireNoRestrictedImports () {
87043
87289
  * @private
87044
87290
  */
87045
87291
  function isRestrictedPattern(importSource, group) {
87046
- return group.matcher.ignores(importSource);
87292
+ return group.regexMatcher ? group.regexMatcher.test(importSource) : group.matcher.ignores(importSource);
87047
87293
  }
87048
87294
 
87049
87295
  /**
@@ -92951,6 +93197,36 @@ function requireNoUnusedVars () {
92951
93197
  }
92952
93198
  }
92953
93199
 
93200
+ /**
93201
+ * Determines what variable type a def is.
93202
+ * @param {Object} def the declaration to check
93203
+ * @returns {VariableType} a simple name for the types of variables that this rule supports
93204
+ */
93205
+ function defToVariableType(def) {
93206
+
93207
+ /*
93208
+ * This `destructuredArrayIgnorePattern` error report works differently from the catch
93209
+ * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the
93210
+ * `destructuredArrayIgnorePattern` will be checked for array destructuring. However,
93211
+ * for the purposes of the report, the currently defined behavior is to only inform the
93212
+ * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact
93213
+ * that the `varsIgnorePattern` would also apply). If it's not present, the user will be
93214
+ * informed of the `varsIgnorePattern`, assuming that's present.
93215
+ */
93216
+ if (config.destructuredArrayIgnorePattern && def.name.parent.type === "ArrayPattern") {
93217
+ return "array-destructure";
93218
+ }
93219
+
93220
+ switch (def.type) {
93221
+ case "CatchClause":
93222
+ return "catch-clause";
93223
+ case "Parameter":
93224
+ return "parameter";
93225
+ default:
93226
+ return "variable";
93227
+ }
93228
+ }
93229
+
92954
93230
  /**
92955
93231
  * Gets a given variable's description and configured ignore pattern
92956
93232
  * based on the provided variableType
@@ -92971,7 +93247,7 @@ function requireNoUnusedVars () {
92971
93247
 
92972
93248
  case "catch-clause":
92973
93249
  pattern = config.caughtErrorsIgnorePattern;
92974
- variableDescription = "args";
93250
+ variableDescription = "caught errors";
92975
93251
  break;
92976
93252
 
92977
93253
  case "parameter":
@@ -93006,28 +93282,7 @@ function requireNoUnusedVars () {
93006
93282
  let additionalMessageData = "";
93007
93283
 
93008
93284
  if (def) {
93009
- let pattern;
93010
- let variableDescription;
93011
-
93012
- switch (def.type) {
93013
- case "CatchClause":
93014
- if (config.caughtErrorsIgnorePattern) {
93015
- [variableDescription, pattern] = getVariableDescription("catch-clause");
93016
- }
93017
- break;
93018
-
93019
- case "Parameter":
93020
- if (config.argsIgnorePattern) {
93021
- [variableDescription, pattern] = getVariableDescription("parameter");
93022
- }
93023
- break;
93024
-
93025
- default:
93026
- if (config.varsIgnorePattern) {
93027
- [variableDescription, pattern] = getVariableDescription("variable");
93028
- }
93029
- break;
93030
- }
93285
+ const [variableDescription, pattern] = getVariableDescription(defToVariableType(def));
93031
93286
 
93032
93287
  if (pattern && variableDescription) {
93033
93288
  additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
@@ -93052,14 +93307,7 @@ function requireNoUnusedVars () {
93052
93307
  let additionalMessageData = "";
93053
93308
 
93054
93309
  if (def) {
93055
- let pattern;
93056
- let variableDescription;
93057
-
93058
- if (def.name.parent.type === "ArrayPattern" && config.destructuredArrayIgnorePattern) {
93059
- [variableDescription, pattern] = getVariableDescription("array-destructure");
93060
- } else if (config.varsIgnorePattern) {
93061
- [variableDescription, pattern] = getVariableDescription("variable");
93062
- }
93310
+ const [variableDescription, pattern] = getVariableDescription(defToVariableType(def));
93063
93311
 
93064
93312
  if (pattern && variableDescription) {
93065
93313
  additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
@@ -93142,7 +93390,7 @@ function requireNoUnusedVars () {
93142
93390
  /**
93143
93391
  * Determines if a variable has a sibling rest property
93144
93392
  * @param {Variable} variable eslint-scope variable object.
93145
- * @returns {boolean} True if the variable is exported, false if not.
93393
+ * @returns {boolean} True if the variable has a sibling rest property, false if not.
93146
93394
  * @private
93147
93395
  */
93148
93396
  function hasRestSpreadSibling(variable) {
@@ -94693,11 +94941,11 @@ function requireNoUselessBackreference () {
94693
94941
  schema: [],
94694
94942
 
94695
94943
  messages: {
94696
- nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' from within that group.",
94697
- forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears later in the pattern.",
94698
- backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears before in the same lookbehind.",
94699
- disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in another alternative.",
94700
- intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in a negative lookaround."
94944
+ nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} from within that group.",
94945
+ forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears later in the pattern.",
94946
+ backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears before in the same lookbehind.",
94947
+ disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in another alternative.",
94948
+ intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in a negative lookaround."
94701
94949
  }
94702
94950
  },
94703
94951
 
@@ -94725,16 +94973,21 @@ function requireNoUselessBackreference () {
94725
94973
 
94726
94974
  visitRegExpAST(regExpAST, {
94727
94975
  onBackreferenceEnter(bref) {
94728
- const group = bref.resolved,
94729
- brefPath = getPathToRoot(bref),
94730
- groupPath = getPathToRoot(group);
94731
- let messageId = null;
94976
+ const groups = [bref.resolved].flat(),
94977
+ brefPath = getPathToRoot(bref);
94732
94978
 
94733
- if (brefPath.includes(group)) {
94979
+ const problems = groups.map(group => {
94980
+ const groupPath = getPathToRoot(group);
94981
+
94982
+ if (brefPath.includes(group)) {
94983
+
94984
+ // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match.
94985
+ return {
94986
+ messageId: "nested",
94987
+ group
94988
+ };
94989
+ }
94734
94990
 
94735
- // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match.
94736
- messageId = "nested";
94737
- } else {
94738
94991
 
94739
94992
  // Start from the root to find the lowest common ancestor.
94740
94993
  let i = brefPath.length - 1,
@@ -94751,35 +95004,80 @@ function requireNoUselessBackreference () {
94751
95004
  lowestCommonLookaround = commonPath.find(isLookaround),
94752
95005
  isMatchingBackward = lowestCommonLookaround && lowestCommonLookaround.kind === "lookbehind";
94753
95006
 
95007
+ if (groupCut.at(-1).type === "Alternative") {
95008
+
95009
+ // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive.
95010
+ return {
95011
+ messageId: "disjunctive",
95012
+ group
95013
+ };
95014
+ }
94754
95015
  if (!isMatchingBackward && bref.end <= group.start) {
94755
95016
 
94756
95017
  // bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match.
94757
- messageId = "forward";
94758
- } else if (isMatchingBackward && group.end <= bref.start) {
95018
+ return {
95019
+ messageId: "forward",
95020
+ group
95021
+ };
95022
+ }
95023
+ if (isMatchingBackward && group.end <= bref.start) {
94759
95024
 
94760
95025
  // the opposite of the previous when the regex is matching backward in a lookbehind context.
94761
- messageId = "backward";
94762
- } else if (groupCut.at(-1).type === "Alternative") {
94763
-
94764
- // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive.
94765
- messageId = "disjunctive";
94766
- } else if (groupCut.some(isNegativeLookaround)) {
95026
+ return {
95027
+ messageId: "backward",
95028
+ group
95029
+ };
95030
+ }
95031
+ if (groupCut.some(isNegativeLookaround)) {
94767
95032
 
94768
95033
  // group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match.
94769
- messageId = "intoNegativeLookaround";
95034
+ return {
95035
+ messageId: "intoNegativeLookaround",
95036
+ group
95037
+ };
94770
95038
  }
95039
+
95040
+ return null;
95041
+ });
95042
+
95043
+ if (problems.length === 0 || problems.some(problem => !problem)) {
95044
+
95045
+ // If there are no problems or no problems with any group then do not report it.
95046
+ return;
94771
95047
  }
94772
95048
 
94773
- if (messageId) {
94774
- context.report({
94775
- node,
94776
- messageId,
94777
- data: {
94778
- bref: bref.raw,
94779
- group: group.raw
94780
- }
94781
- });
95049
+ let problemsToReport;
95050
+
95051
+ // Gets problems that appear in the same disjunction.
95052
+ const problemsInSameDisjunction = problems.filter(problem => problem.messageId !== "disjunctive");
95053
+
95054
+ if (problemsInSameDisjunction.length) {
95055
+
95056
+ // Only report problems that appear in the same disjunction.
95057
+ problemsToReport = problemsInSameDisjunction;
95058
+ } else {
95059
+
95060
+ // If all groups appear in different disjunctions, report it.
95061
+ problemsToReport = problems;
94782
95062
  }
95063
+
95064
+ const [{ messageId, group }, ...other] = problemsToReport;
95065
+ let otherGroups = "";
95066
+
95067
+ if (other.length === 1) {
95068
+ otherGroups = " and another group";
95069
+ } else if (other.length > 1) {
95070
+ otherGroups = ` and other ${other.length} groups`;
95071
+ }
95072
+ context.report({
95073
+ node,
95074
+ messageId,
95075
+ data: {
95076
+ bref: bref.raw,
95077
+ group: group.raw,
95078
+ otherGroups
95079
+ }
95080
+ });
94783
95081
  }
94784
95082
  });
94785
95083
  }
@@ -114049,6 +114347,7 @@ function requireCjs () {
114049
114347
  const MINIMATCH_OPTIONS = {
114050
114348
  // matchBase: true,
114051
114349
  dot: true,
114350
+ allowWindowsEscape: true,
114052
114351
  };
114053
114352
 
114054
114353
  /**
@@ -116403,7 +116702,9 @@ function requireJs () {
116403
116702
  // Type Definitions
116404
116703
  //-----------------------------------------------------------------------------
116405
116704
 
116406
- /** @typedef {import("../../linter/vfile").VFile} VFile */
116705
+ /** @typedef {import("@eslint/core").File} File */
116706
+ /** @typedef {import("@eslint/core").Language} Language */
116707
+ /** @typedef {import("@eslint/core").OkParseResult} OkParseResult */
116407
116708
 
116408
116709
  //-----------------------------------------------------------------------------
116409
116710
  // Helpers
@@ -116439,6 +116740,9 @@ function requireJs () {
116439
116740
  // Exports
116440
116741
  //-----------------------------------------------------------------------------
116441
116742
 
116743
+ /**
116744
+ * @type {Language}
116745
+ */
116442
116746
  js = {
116443
116747
 
116444
116748
  fileType: "text",
@@ -116526,7 +116830,7 @@ function requireJs () {
116526
116830
 
116527
116831
  /**
116528
116832
  * Parses the given file into an AST.
116529
- * @param {VFile} file The virtual file to parse.
116833
+ * @param {File} file The virtual file to parse.
116530
116834
  * @param {Object} options Additional options passed from ESLint.
116531
116835
  * @param {LanguageOptions} options.languageOptions The language options.
116532
116836
  * @returns {Object} The result of parsing.
@@ -116583,7 +116887,7 @@ function requireJs () {
116583
116887
  } catch (ex) {
116584
116888
 
116585
116889
  // If the message includes a leading line number, strip it:
116586
- const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;
116890
+ const message = ex.message.replace(/^line \d+:/iu, "").trim();
116587
116891
 
116588
116892
  debug("%s\n%s", message, ex.stack);
116589
116893
 
@@ -116601,8 +116905,8 @@ function requireJs () {
116601
116905
 
116602
116906
  /**
116603
116907
  * Creates a new `SourceCode` object from the given information.
116604
- * @param {VFile} file The virtual file to create a `SourceCode` object from.
116605
- * @param {Object} parseResult The result returned from `parse()`.
116908
+ * @param {File} file The virtual file to create a `SourceCode` object from.
116909
+ * @param {OkParseResult} parseResult The result returned from `parse()`.
116606
116910
  * @param {Object} options Additional options passed from ESLint.
116607
116911
  * @param {LanguageOptions} options.languageOptions The language options.
116608
116912
  * @returns {SourceCode} The new `SourceCode` object.
@@ -117143,6 +117447,40 @@ function requireFlatConfigArray () {
117143
117447
  return flatConfigArray;
117144
117448
  }
117145
117449
 
117450
+ /**
117451
+ * @fileoverview Shared flags for ESLint.
117452
+ */
117453
+
117454
+ var flags;
117455
+ var hasRequiredFlags;
117456
+
117457
+ function requireFlags () {
117458
+ if (hasRequiredFlags) return flags;
117459
+ hasRequiredFlags = 1;
117460
+
117461
+ /**
117462
+ * The set of flags that change ESLint behavior with a description.
117463
+ * @type {Map<string, string>}
117464
+ */
117465
+ const activeFlags = new Map([
117466
+ ["test_only", "This flag is only used for testing."]
117467
+ ]);
117468
+
117469
+ /**
117470
+ * The set of flags that used to be active but no longer have an effect.
117471
+ * @type {Map<string, string>}
117472
+ */
117473
+ const inactiveFlags = new Map([
117474
+ ["test_only_old", "This flag is no longer used for testing."]
117475
+ ]);
117476
+
117477
+ flags = {
117478
+ activeFlags,
117479
+ inactiveFlags
117480
+ };
117481
+ return flags;
117482
+ }
117483
+
117146
117484
  /**
117147
117485
  * @fileoverview Virtual file
117148
117486
  * @author Nicholas C. Zakas
@@ -117155,6 +117493,12 @@ function requireVfile () {
117155
117493
  if (hasRequiredVfile) return vfile;
117156
117494
  hasRequiredVfile = 1;
117157
117495
 
117496
+ //-----------------------------------------------------------------------------
117497
+ // Type Definitions
117498
+ //-----------------------------------------------------------------------------
117499
+
117500
+ /** @typedef {import("@eslint/core").File} File */
117501
+
117158
117502
  //------------------------------------------------------------------------------
117159
117503
  // Helpers
117160
117504
  //------------------------------------------------------------------------------
@@ -117204,6 +117548,7 @@ function requireVfile () {
117204
117548
 
117205
117549
  /**
117206
117550
  * Represents a virtual file inside of ESLint.
117551
+ * @implements {File}
117207
117552
  */
117208
117553
  class VFile {
117209
117554
 
@@ -117301,6 +117646,7 @@ function requireLinter () {
117301
117646
  const { assertIsRuleSeverity } = requireFlatConfigSchema();
117302
117647
  const { normalizeSeverityToString } = requireSeverity();
117303
117648
  const jslang = requireJs();
117649
+ const { activeFlags } = requireFlags();
117304
117650
  const debug = requireSrc()("eslint:linter");
117305
117651
  const MAX_AUTOFIX_PASSES = 10;
117306
117652
  const DEFAULT_PARSER_NAME = "espree";
@@ -117327,6 +117673,10 @@ function requireLinter () {
117327
117673
  /** @typedef {import("../shared/types").Processor} Processor */
117328
117674
  /** @typedef {import("../shared/types").Rule} Rule */
117329
117675
  /** @typedef {import("../shared/types").Times} Times */
117676
+ /** @typedef {import("@eslint/core").Language} Language */
117677
+ /** @typedef {import("@eslint/core").RuleSeverity} RuleSeverity */
117678
+ /** @typedef {import("@eslint/core").RuleConfig} RuleConfig */
117679
+
117330
117680
 
117331
117681
  /* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
117332
117682
  /**
@@ -117531,7 +117881,7 @@ function requireLinter () {
117531
117881
  * @param {string} [options.ruleId] the ruleId to report
117532
117882
  * @param {Object} [options.loc] the loc to report
117533
117883
  * @param {string} [options.message] the error message to report
117534
- * @param {string} [options.severity] the error message to report
117884
+ * @param {RuleSeverity} [options.severity] the error message to report
117535
117885
  * @param {Language} [options.language] the language to use to adjust the location information
117536
117886
  * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId.
117537
117887
  * @private
@@ -117573,9 +117923,10 @@ function requireLinter () {
117573
117923
  * @param {string} options.justification The justification of the directive
117574
117924
  * @param {ASTNode|token} options.node The Comment node/token.
117575
117925
  * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
117926
+ * @param {Language} language The language to use to adjust the location information.
117576
117927
  * @returns {Object} Directives and problems from the comment
117577
117928
  */
117578
- function createDisableDirectives({ type, value, justification, node }, ruleMapper) {
117929
+ function createDisableDirectives({ type, value, justification, node }, ruleMapper, language) {
117579
117930
  const ruleIds = Object.keys(commentParser.parseListConfig(value));
117580
117931
  const directiveRules = ruleIds.length ? ruleIds : [null];
117581
117932
  const result = {
@@ -117589,26 +117940,36 @@ function requireLinter () {
117589
117940
  // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
117590
117941
  if (ruleId === null || !!ruleMapper(ruleId)) {
117591
117942
  if (type === "disable-next-line") {
117943
+ const { line, column } = updateLocationInformation(
117944
+ node.loc.end,
117945
+ language
117946
+ );
117947
+
117592
117948
  result.directives.push({
117593
117949
  parentDirective,
117594
117950
  type,
117595
- line: node.loc.end.line,
117596
- column: node.loc.end.column + 1,
117951
+ line,
117952
+ column,
117597
117953
  ruleId,
117598
117954
  justification
117599
117955
  });
117600
117956
  } else {
117957
+ const { line, column } = updateLocationInformation(
117958
+ node.loc.start,
117959
+ language
117960
+ );
117961
+
117601
117962
  result.directives.push({
117602
117963
  parentDirective,
117603
117964
  type,
117604
- line: node.loc.start.line,
117605
- column: node.loc.start.column + 1,
117965
+ line,
117966
+ column,
117606
117967
  ruleId,
117607
117968
  justification
117608
117969
  });
117609
117970
  }
117610
117971
  } else {
117611
- result.directiveProblems.push(createLintingProblem({ ruleId, loc: node.loc }));
117972
+ result.directiveProblems.push(createLintingProblem({ ruleId, loc: node.loc, language }));
117612
117973
  }
117613
117974
  }
117614
117975
  return result;
@@ -117686,7 +118047,7 @@ function requireLinter () {
117686
118047
  value: directiveValue,
117687
118048
  justification: justificationPart,
117688
118049
  node: comment
117689
- }, ruleMapper);
118050
+ }, ruleMapper, jslang);
117690
118051
 
117691
118052
  disableDirectives.push(...directives);
117692
118053
  problems.push(...directiveProblems);
@@ -117726,7 +118087,7 @@ function requireLinter () {
117726
118087
  break;
117727
118088
 
117728
118089
  case "eslint": {
117729
- const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc);
118090
+ const parseResult = commentParser.parseJsonConfig(directiveValue);
117730
118091
 
117731
118092
  if (parseResult.success) {
117732
118093
  Object.keys(parseResult.config).forEach(name => {
@@ -117813,7 +118174,14 @@ function requireLinter () {
117813
118174
  configuredRules[name] = ruleOptions;
117814
118175
  });
117815
118176
  } else {
117816
- problems.push(parseResult.error);
118177
+ const problem = createLintingProblem({
118178
+ ruleId: null,
118179
+ loc: comment.loc,
118180
+ message: parseResult.error.message
118181
+ });
118182
+
118183
+ problem.fatal = true;
118184
+ problems.push(problem);
117817
118185
  }
117818
118186
 
117819
118187
  break;
@@ -117844,22 +118212,24 @@ function requireLinter () {
117844
118212
  const disableDirectives = [];
117845
118213
  const problems = [];
117846
118214
 
117847
- const {
117848
- directives: directivesSources,
117849
- problems: directivesProblems
117850
- } = sourceCode.getDisableDirectives();
118215
+ if (sourceCode.getDisableDirectives) {
118216
+ const {
118217
+ directives: directivesSources,
118218
+ problems: directivesProblems
118219
+ } = sourceCode.getDisableDirectives();
117851
118220
 
117852
- problems.push(...directivesProblems.map(directiveProblem => createLintingProblem({
117853
- ...directiveProblem,
117854
- language
117855
- })));
118221
+ problems.push(...directivesProblems.map(directiveProblem => createLintingProblem({
118222
+ ...directiveProblem,
118223
+ language
118224
+ })));
117856
118225
 
117857
- directivesSources.forEach(directive => {
117858
- const { directives, directiveProblems } = createDisableDirectives(directive, ruleMapper);
118226
+ directivesSources.forEach(directive => {
118227
+ const { directives, directiveProblems } = createDisableDirectives(directive, ruleMapper, language);
117859
118228
 
117860
- disableDirectives.push(...directives);
117861
- problems.push(...directiveProblems);
117862
- });
118229
+ disableDirectives.push(...directives);
118230
+ problems.push(...directiveProblems);
118231
+ });
118232
+ }
117863
118233
 
117864
118234
  return {
117865
118235
  problems,
@@ -118112,7 +118482,7 @@ function requireLinter () {
118112
118482
 
118113
118483
  /**
118114
118484
  * Get the options for a rule (not including severity), if any
118115
- * @param {Array|number} ruleConfig rule configuration
118485
+ * @param {RuleConfig} ruleConfig rule configuration
118116
118486
  * @returns {Array} of rule options, empty Array if none
118117
118487
  */
118118
118488
  function getRuleOptions(ruleConfig) {
@@ -118176,7 +118546,7 @@ function requireLinter () {
118176
118546
  nodeType: null,
118177
118547
  fatal: true,
118178
118548
  severity: 2,
118179
- message: error.message,
118549
+ message: `Parsing error: ${error.message}`,
118180
118550
  line: error.line,
118181
118551
  column: error.column
118182
118552
  }))
@@ -118378,9 +118748,9 @@ function requireLinter () {
118378
118748
  });
118379
118749
 
118380
118750
  const eventGenerator = new NodeEventGenerator(emitter, {
118381
- visitorKeys: sourceCode.visitorKeys,
118751
+ visitorKeys: sourceCode.visitorKeys ?? language.visitorKeys,
118382
118752
  fallback: Traverser.getKeys,
118383
- matchClass: language.matchesSelectorClass,
118753
+ matchClass: language.matchesSelectorClass ?? (() => false),
118384
118754
  nodeTypeKey: language.nodeTypeKey
118385
118755
  });
118386
118756
 
@@ -118509,11 +118879,13 @@ function requireLinter () {
118509
118879
  * Initialize the Linter.
118510
118880
  * @param {Object} [config] the config object
118511
118881
  * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
118882
+ * @param {Array<string>} [config.flags] the feature flags to enable.
118512
118883
  * @param {"flat"|"eslintrc"} [config.configType="flat"] the type of config used.
118513
118884
  */
118514
- constructor({ cwd, configType = "flat" } = {}) {
118885
+ constructor({ cwd, configType = "flat", flags = [] } = {}) {
118515
118886
  internalSlotsMap.set(this, {
118516
118887
  cwd: normalizeCwd(cwd),
118888
+ flags: flags.filter(flag => activeFlags.has(flag)),
118517
118889
  lastConfigArray: null,
118518
118890
  lastSourceCode: null,
118519
118891
  lastSuppressedMessages: [],
@@ -118534,6 +118906,15 @@ function requireLinter () {
118534
118906
  return pkg.version;
118535
118907
  }
118536
118908
 
118909
+ /**
118910
+ * Indicates if the given feature flag is enabled for this instance.
118911
+ * @param {string} flag The feature flag to check.
118912
+ * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
118913
+ */
118914
+ hasFlag(flag) {
118915
+ return internalSlotsMap.get(this).flags.includes(flag);
118916
+ }
118917
+
118537
118918
  /**
118538
118919
  * Same as linter.verify, except without support for processors.
118539
118920
  * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
@@ -118935,8 +119316,13 @@ function requireLinter () {
118935
119316
  /*
118936
119317
  * If the given source code object as the first argument does not have scopeManager, analyze the scope.
118937
119318
  * This is for backward compatibility (SourceCode is frozen so it cannot rebind).
119319
+ *
119320
+ * We check explicitly for `null` to ensure that this is a JS-flavored language.
119321
+ * For non-JS languages we don't want to do this.
119322
+ *
119323
+ * TODO: Remove this check when we stop exporting the `SourceCode` object.
118938
119324
  */
118939
- if (!slots.lastSourceCode.scopeManager) {
119325
+ if (slots.lastSourceCode.scopeManager === null) {
118940
119326
  slots.lastSourceCode = new SourceCode({
118941
119327
  text: slots.lastSourceCode.text,
118942
119328
  ast: slots.lastSourceCode.ast,
@@ -118955,7 +119341,7 @@ function requireLinter () {
118955
119341
  * this is primarily about adding variables into the global scope
118956
119342
  * to account for ecmaVersion and configured globals.
118957
119343
  */
118958
- sourceCode.applyLanguageOptions(languageOptions);
119344
+ sourceCode.applyLanguageOptions?.(languageOptions);
118959
119345
 
118960
119346
  const mergedInlineConfig = {
118961
119347
  rules: {}
@@ -118972,147 +119358,151 @@ function requireLinter () {
118972
119358
 
118973
119359
  // if inline config should warn then add the warnings
118974
119360
  if (options.warnInlineConfig) {
118975
- sourceCode.getInlineConfigNodes().forEach(node => {
118976
- inlineConfigProblems.push(createLintingProblem({
118977
- ruleId: null,
118978
- message: `'${sourceCode.text.slice(node.range[0], node.range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`,
118979
- loc: node.loc,
118980
- severity: 1,
118981
- language: config.language
118982
- }));
119361
+ if (sourceCode.getInlineConfigNodes) {
119362
+ sourceCode.getInlineConfigNodes().forEach(node => {
119363
+ inlineConfigProblems.push(createLintingProblem({
119364
+ ruleId: null,
119365
+ message: `'${sourceCode.text.slice(node.range[0], node.range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`,
119366
+ loc: node.loc,
119367
+ severity: 1,
119368
+ language: config.language
119369
+ }));
118983
119370
 
118984
- });
119371
+ });
119372
+ }
118985
119373
  } else {
118986
- const inlineConfigResult = sourceCode.applyInlineConfig();
118987
-
118988
- inlineConfigProblems.push(
118989
- ...inlineConfigResult.problems
118990
- .map(problem => createLintingProblem({ ...problem, language: config.language }))
118991
- .map(problem => {
118992
- problem.fatal = true;
118993
- return problem;
118994
- })
118995
- );
119374
+ const inlineConfigResult = sourceCode.applyInlineConfig?.();
119375
+
119376
+ if (inlineConfigResult) {
119377
+ inlineConfigProblems.push(
119378
+ ...inlineConfigResult.problems
119379
+ .map(problem => createLintingProblem({ ...problem, language: config.language }))
119380
+ .map(problem => {
119381
+ problem.fatal = true;
119382
+ return problem;
119383
+ })
119384
+ );
118996
119385
 
118997
- // next we need to verify information about the specified rules
118998
- const ruleValidator = new RuleValidator();
119386
+ // next we need to verify information about the specified rules
119387
+ const ruleValidator = new RuleValidator();
118999
119388
 
119000
- for (const { config: inlineConfig, node } of inlineConfigResult.configs) {
119389
+ for (const { config: inlineConfig, loc } of inlineConfigResult.configs) {
119001
119390
 
119002
- Object.keys(inlineConfig.rules).forEach(ruleId => {
119003
- const rule = getRuleFromConfig(ruleId, config);
119004
- const ruleValue = inlineConfig.rules[ruleId];
119391
+ Object.keys(inlineConfig.rules).forEach(ruleId => {
119392
+ const rule = getRuleFromConfig(ruleId, config);
119393
+ const ruleValue = inlineConfig.rules[ruleId];
119005
119394
 
119006
- if (!rule) {
119007
- inlineConfigProblems.push(createLintingProblem({
119008
- ruleId,
119009
- loc: node.loc,
119010
- language: config.language
119011
- }));
119012
- return;
119013
- }
119395
+ if (!rule) {
119396
+ inlineConfigProblems.push(createLintingProblem({
119397
+ ruleId,
119398
+ loc,
119399
+ language: config.language
119400
+ }));
119401
+ return;
119402
+ }
119014
119403
 
119015
- if (Object.hasOwn(mergedInlineConfig.rules, ruleId)) {
119016
- inlineConfigProblems.push(createLintingProblem({
119017
- message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
119018
- loc: node.loc,
119019
- language: config.language
119020
- }));
119021
- return;
119022
- }
119404
+ if (Object.hasOwn(mergedInlineConfig.rules, ruleId)) {
119405
+ inlineConfigProblems.push(createLintingProblem({
119406
+ message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
119407
+ loc,
119408
+ language: config.language
119409
+ }));
119410
+ return;
119411
+ }
119023
119412
 
119024
- try {
119413
+ try {
119025
119414
 
119026
- let ruleOptions = Array.isArray(ruleValue) ? ruleValue : [ruleValue];
119415
+ let ruleOptions = Array.isArray(ruleValue) ? ruleValue : [ruleValue];
119027
119416
 
119028
- assertIsRuleSeverity(ruleId, ruleOptions[0]);
119417
+ assertIsRuleSeverity(ruleId, ruleOptions[0]);
119029
119418
 
119030
- /*
119031
- * If the rule was already configured, inline rule configuration that
119032
- * only has severity should retain options from the config and just override the severity.
119033
- *
119034
- * Example:
119035
- *
119036
- * {
119037
- * rules: {
119038
- * curly: ["error", "multi"]
119039
- * }
119040
- * }
119041
- *
119042
- * /* eslint curly: ["warn"] * /
119043
- *
119044
- * Results in:
119045
- *
119046
- * curly: ["warn", "multi"]
119047
- */
119419
+ /*
119420
+ * If the rule was already configured, inline rule configuration that
119421
+ * only has severity should retain options from the config and just override the severity.
119422
+ *
119423
+ * Example:
119424
+ *
119425
+ * {
119426
+ * rules: {
119427
+ * curly: ["error", "multi"]
119428
+ * }
119429
+ * }
119430
+ *
119431
+ * /* eslint curly: ["warn"] * /
119432
+ *
119433
+ * Results in:
119434
+ *
119435
+ * curly: ["warn", "multi"]
119436
+ */
119048
119437
 
119049
- let shouldValidateOptions = true;
119438
+ let shouldValidateOptions = true;
119050
119439
 
119051
- if (
119440
+ if (
119052
119441
 
119053
- /*
119054
- * If inline config for the rule has only severity
119055
- */
119056
- ruleOptions.length === 1 &&
119442
+ /*
119443
+ * If inline config for the rule has only severity
119444
+ */
119445
+ ruleOptions.length === 1 &&
119057
119446
 
119058
- /*
119059
- * And the rule was already configured
119060
- */
119061
- config.rules && Object.hasOwn(config.rules, ruleId)
119062
- ) {
119447
+ /*
119448
+ * And the rule was already configured
119449
+ */
119450
+ config.rules && Object.hasOwn(config.rules, ruleId)
119451
+ ) {
119063
119452
 
119064
- /*
119065
- * Then use severity from the inline config and options from the provided config
119066
- */
119067
- ruleOptions = [
119068
- ruleOptions[0], // severity from the inline config
119069
- ...config.rules[ruleId].slice(1) // options from the provided config
119070
- ];
119453
+ /*
119454
+ * Then use severity from the inline config and options from the provided config
119455
+ */
119456
+ ruleOptions = [
119457
+ ruleOptions[0], // severity from the inline config
119458
+ ...config.rules[ruleId].slice(1) // options from the provided config
119459
+ ];
119460
+
119461
+ // if the rule was enabled, the options have already been validated
119462
+ if (config.rules[ruleId][0] > 0) {
119463
+ shouldValidateOptions = false;
119464
+ }
119465
+ }
119071
119466
 
119072
- // if the rule was enabled, the options have already been validated
119073
- if (config.rules[ruleId][0] > 0) {
119074
- shouldValidateOptions = false;
119467
+ if (shouldValidateOptions) {
119468
+ ruleValidator.validate({
119469
+ plugins: config.plugins,
119470
+ rules: {
119471
+ [ruleId]: ruleOptions
119472
+ }
119473
+ });
119075
119474
  }
119076
- }
119077
119475
 
119078
- if (shouldValidateOptions) {
119079
- ruleValidator.validate({
119080
- plugins: config.plugins,
119081
- rules: {
119082
- [ruleId]: ruleOptions
119083
- }
119084
- });
119085
- }
119476
+ mergedInlineConfig.rules[ruleId] = ruleOptions;
119477
+ } catch (err) {
119086
119478
 
119087
- mergedInlineConfig.rules[ruleId] = ruleOptions;
119088
- } catch (err) {
119479
+ /*
119480
+ * If the rule has invalid `meta.schema`, throw the error because
119481
+ * this is not an invalid inline configuration but an invalid rule.
119482
+ */
119483
+ if (err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA") {
119484
+ throw err;
119485
+ }
119089
119486
 
119090
- /*
119091
- * If the rule has invalid `meta.schema`, throw the error because
119092
- * this is not an invalid inline configuration but an invalid rule.
119093
- */
119094
- if (err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA") {
119095
- throw err;
119096
- }
119487
+ let baseMessage = err.message.slice(
119488
+ err.message.startsWith("Key \"rules\":")
119489
+ ? err.message.indexOf(":", 12) + 1
119490
+ : err.message.indexOf(":") + 1
119491
+ ).trim();
119097
119492
 
119098
- let baseMessage = err.message.slice(
119099
- err.message.startsWith("Key \"rules\":")
119100
- ? err.message.indexOf(":", 12) + 1
119101
- : err.message.indexOf(":") + 1
119102
- ).trim();
119493
+ if (err.messageTemplate) {
119494
+ baseMessage += ` You passed "${ruleValue}".`;
119495
+ }
119103
119496
 
119104
- if (err.messageTemplate) {
119105
- baseMessage += ` You passed "${ruleValue}".`;
119497
+ inlineConfigProblems.push(createLintingProblem({
119498
+ ruleId,
119499
+ message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`,
119500
+ loc,
119501
+ language: config.language
119502
+ }));
119106
119503
  }
119107
-
119108
- inlineConfigProblems.push(createLintingProblem({
119109
- ruleId,
119110
- message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`,
119111
- loc: node.loc,
119112
- language: config.language
119113
- }));
119114
- }
119115
- });
119504
+ });
119505
+ }
119116
119506
  }
119117
119507
  }
119118
119508
  }
@@ -119129,7 +119519,7 @@ function requireLinter () {
119129
119519
 
119130
119520
  let lintingProblems;
119131
119521
 
119132
- sourceCode.finalize();
119522
+ sourceCode.finalize?.();
119133
119523
 
119134
119524
  try {
119135
119525
  lintingProblems = runRules(