@pobammer-ts/eslint-cease-nonsense-rules 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19752,8 +19752,817 @@ var prefer_early_return_default = createRule({
19752
19752
  });
19753
19753
 
19754
19754
  // src/rules/prefer-enum-item.ts
19755
- import { ESLintUtils as ESLintUtils3 } from "@typescript-eslint/utils";
19755
+ import { AST_NODE_TYPES as AST_NODE_TYPES7, ESLintUtils as ESLintUtils3 } from "@typescript-eslint/utils";
19756
+
19757
+ // node_modules/ts-api-utils/lib/index.js
19758
+ import ts9 from "typescript";
19759
+ function isFlagSet(allFlags, flag) {
19760
+ return (allFlags & flag) !== 0;
19761
+ }
19762
+ function isFlagSetOnObject(obj, flag) {
19763
+ return isFlagSet(obj.flags, flag);
19764
+ }
19765
+ var isTypeFlagSet = isFlagSetOnObject;
19766
+ function includesModifier(modifiers, ...kinds) {
19767
+ if (modifiers === undefined) {
19768
+ return false;
19769
+ }
19770
+ for (const modifier of modifiers) {
19771
+ if (kinds.includes(modifier.kind)) {
19772
+ return true;
19773
+ }
19774
+ }
19775
+ return false;
19776
+ }
19777
+ var [tsMajor, tsMinor] = ts9.versionMajorMinor.split(".").map((raw) => Number.parseInt(raw, 10));
19778
+ function isNumericOrStringLikeLiteral(node) {
19779
+ switch (node.kind) {
19780
+ case ts9.SyntaxKind.NoSubstitutionTemplateLiteral:
19781
+ case ts9.SyntaxKind.NumericLiteral:
19782
+ case ts9.SyntaxKind.StringLiteral:
19783
+ return true;
19784
+ default:
19785
+ return false;
19786
+ }
19787
+ }
19788
+ function isFunctionScopeBoundary(node) {
19789
+ switch (node.kind) {
19790
+ case ts9.SyntaxKind.ArrowFunction:
19791
+ case ts9.SyntaxKind.CallSignature:
19792
+ case ts9.SyntaxKind.ClassDeclaration:
19793
+ case ts9.SyntaxKind.ClassExpression:
19794
+ case ts9.SyntaxKind.Constructor:
19795
+ case ts9.SyntaxKind.ConstructorType:
19796
+ case ts9.SyntaxKind.ConstructSignature:
19797
+ case ts9.SyntaxKind.EnumDeclaration:
19798
+ case ts9.SyntaxKind.FunctionDeclaration:
19799
+ case ts9.SyntaxKind.FunctionExpression:
19800
+ case ts9.SyntaxKind.FunctionType:
19801
+ case ts9.SyntaxKind.GetAccessor:
19802
+ case ts9.SyntaxKind.MethodDeclaration:
19803
+ case ts9.SyntaxKind.MethodSignature:
19804
+ case ts9.SyntaxKind.ModuleDeclaration:
19805
+ case ts9.SyntaxKind.SetAccessor:
19806
+ return true;
19807
+ case ts9.SyntaxKind.SourceFile:
19808
+ return ts9.isExternalModule(node);
19809
+ default:
19810
+ return false;
19811
+ }
19812
+ }
19813
+ var IntrinsicTypeFlags = ts9.TypeFlags.Intrinsic ?? ts9.TypeFlags.Any | ts9.TypeFlags.Unknown | ts9.TypeFlags.String | ts9.TypeFlags.Number | ts9.TypeFlags.BigInt | ts9.TypeFlags.Boolean | ts9.TypeFlags.BooleanLiteral | ts9.TypeFlags.ESSymbol | ts9.TypeFlags.Void | ts9.TypeFlags.Undefined | ts9.TypeFlags.Null | ts9.TypeFlags.Never | ts9.TypeFlags.NonPrimitive;
19814
+ function isUnionType(type3) {
19815
+ return isTypeFlagSet(type3, ts9.TypeFlags.Union);
19816
+ }
19817
+ function unionConstituents(type3) {
19818
+ return isUnionType(type3) ? type3.types : [type3];
19819
+ }
19820
+ function identifierToKeywordKind(node) {
19821
+ return "originalKeywordKind" in node ? node.originalKeywordKind : ts9.identifierToKeywordKind(node);
19822
+ }
19823
+ function getDeclarationDomain(node) {
19824
+ switch (node.parent.kind) {
19825
+ case ts9.SyntaxKind.ClassDeclaration:
19826
+ case ts9.SyntaxKind.ClassExpression:
19827
+ return 2 | 4;
19828
+ case ts9.SyntaxKind.EnumDeclaration:
19829
+ return 7;
19830
+ case ts9.SyntaxKind.FunctionDeclaration:
19831
+ case ts9.SyntaxKind.FunctionExpression:
19832
+ return 4;
19833
+ case ts9.SyntaxKind.ImportClause:
19834
+ case ts9.SyntaxKind.NamespaceImport:
19835
+ return 7 | 8;
19836
+ case ts9.SyntaxKind.ImportEqualsDeclaration:
19837
+ case ts9.SyntaxKind.ImportSpecifier:
19838
+ return node.parent.name === node ? 7 | 8 : undefined;
19839
+ case ts9.SyntaxKind.InterfaceDeclaration:
19840
+ case ts9.SyntaxKind.TypeAliasDeclaration:
19841
+ case ts9.SyntaxKind.TypeParameter:
19842
+ return 2;
19843
+ case ts9.SyntaxKind.ModuleDeclaration:
19844
+ return 1;
19845
+ case ts9.SyntaxKind.Parameter:
19846
+ if (node.parent.parent.kind === ts9.SyntaxKind.IndexSignature || identifierToKeywordKind(node) === ts9.SyntaxKind.ThisKeyword) {
19847
+ return;
19848
+ }
19849
+ case ts9.SyntaxKind.BindingElement:
19850
+ case ts9.SyntaxKind.VariableDeclaration:
19851
+ return node.parent.name === node ? 4 : undefined;
19852
+ }
19853
+ }
19854
+ function getPropertyName(propertyName) {
19855
+ if (propertyName.kind === ts9.SyntaxKind.ComputedPropertyName) {
19856
+ const expression = unwrapParentheses(propertyName.expression);
19857
+ if (ts9.isPrefixUnaryExpression(expression)) {
19858
+ let negate = false;
19859
+ switch (expression.operator) {
19860
+ case ts9.SyntaxKind.MinusToken:
19861
+ negate = true;
19862
+ case ts9.SyntaxKind.PlusToken:
19863
+ return ts9.isNumericLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text}` : ts9.isBigIntLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text.slice(0, -1)}` : undefined;
19864
+ default:
19865
+ return;
19866
+ }
19867
+ }
19868
+ if (ts9.isBigIntLiteral(expression)) {
19869
+ return expression.text.slice(0, -1);
19870
+ }
19871
+ if (isNumericOrStringLikeLiteral(expression)) {
19872
+ return expression.text;
19873
+ }
19874
+ return;
19875
+ }
19876
+ return propertyName.kind === ts9.SyntaxKind.PrivateIdentifier ? undefined : propertyName.text;
19877
+ }
19878
+ function unwrapParentheses(node) {
19879
+ while (node.kind === ts9.SyntaxKind.ParenthesizedExpression) {
19880
+ node = node.expression;
19881
+ }
19882
+ return node;
19883
+ }
19884
+ function getUsageDomain(node) {
19885
+ const parent = node.parent;
19886
+ switch (parent.kind) {
19887
+ case ts9.SyntaxKind.BindingElement:
19888
+ if (parent.initializer === node) {
19889
+ return 5;
19890
+ }
19891
+ break;
19892
+ case ts9.SyntaxKind.BreakStatement:
19893
+ case ts9.SyntaxKind.ClassDeclaration:
19894
+ case ts9.SyntaxKind.ClassExpression:
19895
+ case ts9.SyntaxKind.ContinueStatement:
19896
+ case ts9.SyntaxKind.EnumDeclaration:
19897
+ case ts9.SyntaxKind.FunctionDeclaration:
19898
+ case ts9.SyntaxKind.FunctionExpression:
19899
+ case ts9.SyntaxKind.GetAccessor:
19900
+ case ts9.SyntaxKind.ImportClause:
19901
+ case ts9.SyntaxKind.ImportSpecifier:
19902
+ case ts9.SyntaxKind.InterfaceDeclaration:
19903
+ case ts9.SyntaxKind.JsxAttribute:
19904
+ case ts9.SyntaxKind.LabeledStatement:
19905
+ case ts9.SyntaxKind.MethodDeclaration:
19906
+ case ts9.SyntaxKind.MethodSignature:
19907
+ case ts9.SyntaxKind.ModuleDeclaration:
19908
+ case ts9.SyntaxKind.NamedTupleMember:
19909
+ case ts9.SyntaxKind.NamespaceExport:
19910
+ case ts9.SyntaxKind.NamespaceExportDeclaration:
19911
+ case ts9.SyntaxKind.NamespaceImport:
19912
+ case ts9.SyntaxKind.PropertySignature:
19913
+ case ts9.SyntaxKind.SetAccessor:
19914
+ case ts9.SyntaxKind.TypeAliasDeclaration:
19915
+ case ts9.SyntaxKind.TypeParameter:
19916
+ case ts9.SyntaxKind.TypePredicate:
19917
+ break;
19918
+ case ts9.SyntaxKind.EnumMember:
19919
+ case ts9.SyntaxKind.ImportEqualsDeclaration:
19920
+ case ts9.SyntaxKind.Parameter:
19921
+ case ts9.SyntaxKind.PropertyAccessExpression:
19922
+ case ts9.SyntaxKind.PropertyAssignment:
19923
+ case ts9.SyntaxKind.PropertyDeclaration:
19924
+ case ts9.SyntaxKind.VariableDeclaration:
19925
+ if (parent.name !== node) {
19926
+ return 5;
19927
+ }
19928
+ break;
19929
+ case ts9.SyntaxKind.ExportAssignment:
19930
+ return 7;
19931
+ case ts9.SyntaxKind.ExportSpecifier:
19932
+ if (parent.propertyName === undefined || parent.propertyName === node) {
19933
+ return 7;
19934
+ }
19935
+ break;
19936
+ case ts9.SyntaxKind.ExpressionWithTypeArguments:
19937
+ return parent.parent.token === ts9.SyntaxKind.ImplementsKeyword || parent.parent.parent.kind === ts9.SyntaxKind.InterfaceDeclaration ? 2 : 4;
19938
+ case ts9.SyntaxKind.QualifiedName:
19939
+ if (parent.left === node) {
19940
+ if (getEntityNameParent(parent).kind === ts9.SyntaxKind.TypeQuery) {
19941
+ return 1 | 8;
19942
+ }
19943
+ return 1;
19944
+ }
19945
+ break;
19946
+ case ts9.SyntaxKind.TypeQuery:
19947
+ return 5 | 8;
19948
+ case ts9.SyntaxKind.TypeReference:
19949
+ return identifierToKeywordKind(node) !== ts9.SyntaxKind.ConstKeyword ? 2 : undefined;
19950
+ default:
19951
+ return 5;
19952
+ }
19953
+ }
19954
+ function getEntityNameParent(name) {
19955
+ let parent = name.parent;
19956
+ while (parent.kind === ts9.SyntaxKind.QualifiedName) {
19957
+ parent = parent.parent;
19958
+ }
19959
+ return parent;
19960
+ }
19961
+ function isBlockScopeBoundary(node) {
19962
+ switch (node.kind) {
19963
+ case ts9.SyntaxKind.Block: {
19964
+ const parent = node.parent;
19965
+ return parent.kind !== ts9.SyntaxKind.CatchClause && (parent.kind === ts9.SyntaxKind.SourceFile || !isFunctionScopeBoundary(parent)) ? 2 : 0;
19966
+ }
19967
+ case ts9.SyntaxKind.CaseBlock:
19968
+ case ts9.SyntaxKind.CatchClause:
19969
+ case ts9.SyntaxKind.ForInStatement:
19970
+ case ts9.SyntaxKind.ForOfStatement:
19971
+ case ts9.SyntaxKind.ForStatement:
19972
+ case ts9.SyntaxKind.WithStatement:
19973
+ return 2;
19974
+ default:
19975
+ return 0;
19976
+ }
19977
+ }
19978
+ var AbstractScope = class {
19979
+ constructor(global) {
19980
+ this.global = global;
19981
+ }
19982
+ namespaceScopes = undefined;
19983
+ uses = [];
19984
+ variables = /* @__PURE__ */ new Map;
19985
+ #enumScopes = undefined;
19986
+ addUse(use) {
19987
+ this.uses.push(use);
19988
+ }
19989
+ addVariable(identifier3, name, selector, exported, domain) {
19990
+ const variables = this.getDestinationScope(selector).getVariables();
19991
+ const declaration = {
19992
+ declaration: name,
19993
+ domain,
19994
+ exported
19995
+ };
19996
+ const variable = variables.get(identifier3);
19997
+ if (variable === undefined) {
19998
+ variables.set(identifier3, {
19999
+ declarations: [declaration],
20000
+ domain,
20001
+ uses: []
20002
+ });
20003
+ } else {
20004
+ variable.domain |= domain;
20005
+ variable.declarations.push(declaration);
20006
+ }
20007
+ }
20008
+ createOrReuseEnumScope(name, _exported) {
20009
+ let scope;
20010
+ if (this.#enumScopes === undefined) {
20011
+ this.#enumScopes = /* @__PURE__ */ new Map;
20012
+ } else {
20013
+ scope = this.#enumScopes.get(name);
20014
+ }
20015
+ if (scope === undefined) {
20016
+ scope = new EnumScope(this);
20017
+ this.#enumScopes.set(name, scope);
20018
+ }
20019
+ return scope;
20020
+ }
20021
+ createOrReuseNamespaceScope(name, _exported, ambient, hasExportStatement) {
20022
+ let scope;
20023
+ if (this.namespaceScopes === undefined) {
20024
+ this.namespaceScopes = /* @__PURE__ */ new Map;
20025
+ } else {
20026
+ scope = this.namespaceScopes.get(name);
20027
+ }
20028
+ if (scope === undefined) {
20029
+ scope = new NamespaceScope(ambient, hasExportStatement, this);
20030
+ this.namespaceScopes.set(name, scope);
20031
+ } else {
20032
+ scope.refresh(ambient, hasExportStatement);
20033
+ }
20034
+ return scope;
20035
+ }
20036
+ end(cb) {
20037
+ if (this.namespaceScopes !== undefined) {
20038
+ this.namespaceScopes.forEach((value) => value.finish(cb));
20039
+ }
20040
+ this.namespaceScopes = this.#enumScopes = undefined;
20041
+ this.applyUses();
20042
+ this.variables.forEach((variable) => {
20043
+ for (const declaration of variable.declarations) {
20044
+ const result = {
20045
+ declarations: [],
20046
+ domain: declaration.domain,
20047
+ exported: declaration.exported,
20048
+ inGlobalScope: this.global,
20049
+ uses: []
20050
+ };
20051
+ for (const other of variable.declarations) {
20052
+ if (other.domain & declaration.domain) {
20053
+ result.declarations.push(other.declaration);
20054
+ }
20055
+ }
20056
+ for (const use of variable.uses) {
20057
+ if (use.domain & declaration.domain) {
20058
+ result.uses.push(use);
20059
+ }
20060
+ }
20061
+ cb(result, declaration.declaration, this);
20062
+ }
20063
+ });
20064
+ }
20065
+ getFunctionScope() {
20066
+ return this;
20067
+ }
20068
+ getVariables() {
20069
+ return this.variables;
20070
+ }
20071
+ markExported(_name) {}
20072
+ addUseToParent(_use) {}
20073
+ applyUse(use, variables = this.variables) {
20074
+ const variable = variables.get(use.location.text);
20075
+ if (variable === undefined || (variable.domain & use.domain) === 0) {
20076
+ return false;
20077
+ }
20078
+ variable.uses.push(use);
20079
+ return true;
20080
+ }
20081
+ applyUses() {
20082
+ for (const use of this.uses) {
20083
+ if (!this.applyUse(use)) {
20084
+ this.addUseToParent(use);
20085
+ }
20086
+ }
20087
+ this.uses = [];
20088
+ }
20089
+ };
20090
+ var NonRootScope = class extends AbstractScope {
20091
+ constructor(parent, boundary) {
20092
+ super(false);
20093
+ this.parent = parent;
20094
+ this.boundary = boundary;
20095
+ }
20096
+ getDestinationScope(selector) {
20097
+ return this.boundary & selector ? this : this.parent.getDestinationScope(selector);
20098
+ }
20099
+ addUseToParent(use) {
20100
+ return this.parent.addUse(use, this);
20101
+ }
20102
+ };
20103
+ var AbstractNamedExpressionScope = class extends NonRootScope {
20104
+ #domain;
20105
+ #name;
20106
+ constructor(name, domain, parent) {
20107
+ super(parent, 1);
20108
+ this.#name = name;
20109
+ this.#domain = domain;
20110
+ }
20111
+ addUse(use, source) {
20112
+ if (source !== this.innerScope) {
20113
+ return this.innerScope.addUse(use);
20114
+ }
20115
+ if (use.domain & this.#domain && use.location.text === this.#name.text) {
20116
+ this.uses.push(use);
20117
+ } else {
20118
+ return this.parent.addUse(use, this);
20119
+ }
20120
+ }
20121
+ end(cb) {
20122
+ this.innerScope.end(cb);
20123
+ return cb({
20124
+ declarations: [this.#name],
20125
+ domain: this.#domain,
20126
+ exported: false,
20127
+ inGlobalScope: false,
20128
+ uses: this.uses
20129
+ }, this.#name, this);
20130
+ }
20131
+ getDestinationScope() {
20132
+ return this.innerScope;
20133
+ }
20134
+ getFunctionScope() {
20135
+ return this.innerScope;
20136
+ }
20137
+ };
20138
+ var BlockScope = class extends NonRootScope {
20139
+ #functionScope;
20140
+ constructor(functionScope, parent) {
20141
+ super(parent, 2);
20142
+ this.#functionScope = functionScope;
20143
+ }
20144
+ getFunctionScope() {
20145
+ return this.#functionScope;
20146
+ }
20147
+ };
20148
+ var ClassExpressionScope = class extends AbstractNamedExpressionScope {
20149
+ innerScope = new NonRootScope(this, 1);
20150
+ constructor(name, parent) {
20151
+ super(name, 4 | 2, parent);
20152
+ }
20153
+ };
20154
+ var ConditionalTypeScope = class extends NonRootScope {
20155
+ #state = 0;
20156
+ constructor(parent) {
20157
+ super(parent, 8);
20158
+ }
20159
+ addUse(use) {
20160
+ if (this.#state === 2) {
20161
+ return void this.uses.push(use);
20162
+ }
20163
+ return this.parent.addUse(use, this);
20164
+ }
20165
+ updateState(newState) {
20166
+ this.#state = newState;
20167
+ }
20168
+ };
20169
+ var EnumScope = class extends NonRootScope {
20170
+ constructor(parent) {
20171
+ super(parent, 1);
20172
+ }
20173
+ end() {
20174
+ this.applyUses();
20175
+ }
20176
+ };
20177
+ var FunctionScope = class extends NonRootScope {
20178
+ constructor(parent) {
20179
+ super(parent, 1);
20180
+ }
20181
+ beginBody() {
20182
+ this.applyUses();
20183
+ }
20184
+ };
20185
+ var FunctionExpressionScope = class extends AbstractNamedExpressionScope {
20186
+ innerScope = new FunctionScope(this);
20187
+ constructor(name, parent) {
20188
+ super(name, 4, parent);
20189
+ }
20190
+ beginBody() {
20191
+ return this.innerScope.beginBody();
20192
+ }
20193
+ };
20194
+ var NamespaceScope = class extends NonRootScope {
20195
+ #ambient;
20196
+ #exports = undefined;
20197
+ #hasExport;
20198
+ #innerScope = new NonRootScope(this, 1);
20199
+ constructor(ambient, hasExport, parent) {
20200
+ super(parent, 1);
20201
+ this.#ambient = ambient;
20202
+ this.#hasExport = hasExport;
20203
+ }
20204
+ addUse(use, source) {
20205
+ if (source !== this.#innerScope) {
20206
+ return this.#innerScope.addUse(use);
20207
+ }
20208
+ this.uses.push(use);
20209
+ }
20210
+ createOrReuseEnumScope(name, exported) {
20211
+ if (!exported && (!this.#ambient || this.#hasExport)) {
20212
+ return this.#innerScope.createOrReuseEnumScope(name, exported);
20213
+ }
20214
+ return super.createOrReuseEnumScope(name, exported);
20215
+ }
20216
+ createOrReuseNamespaceScope(name, exported, ambient, hasExportStatement) {
20217
+ if (!exported && (!this.#ambient || this.#hasExport)) {
20218
+ return this.#innerScope.createOrReuseNamespaceScope(name, exported, ambient || this.#ambient, hasExportStatement);
20219
+ }
20220
+ return super.createOrReuseNamespaceScope(name, exported, ambient || this.#ambient, hasExportStatement);
20221
+ }
20222
+ end(cb) {
20223
+ this.#innerScope.end((variable, key, scope) => {
20224
+ if (scope !== this.#innerScope || !variable.exported && (!this.#ambient || this.#exports !== undefined && !this.#exports.has(key.text))) {
20225
+ return cb(variable, key, scope);
20226
+ }
20227
+ const namespaceVar = this.variables.get(key.text);
20228
+ if (namespaceVar === undefined) {
20229
+ this.variables.set(key.text, {
20230
+ declarations: variable.declarations.map(mapDeclaration),
20231
+ domain: variable.domain,
20232
+ uses: [...variable.uses]
20233
+ });
20234
+ } else {
20235
+ outer:
20236
+ for (const declaration of variable.declarations) {
20237
+ for (const existing of namespaceVar.declarations) {
20238
+ if (existing.declaration === declaration) {
20239
+ continue outer;
20240
+ }
20241
+ namespaceVar.declarations.push(mapDeclaration(declaration));
20242
+ }
20243
+ }
20244
+ namespaceVar.domain |= variable.domain;
20245
+ for (const use of variable.uses) {
20246
+ if (namespaceVar.uses.includes(use)) {
20247
+ continue;
20248
+ }
20249
+ namespaceVar.uses.push(use);
20250
+ }
20251
+ }
20252
+ });
20253
+ this.applyUses();
20254
+ this.#innerScope = new NonRootScope(this, 1);
20255
+ }
20256
+ finish(cb) {
20257
+ return super.end(cb);
20258
+ }
20259
+ getDestinationScope() {
20260
+ return this.#innerScope;
20261
+ }
20262
+ markExported(name) {
20263
+ if (this.#exports === undefined) {
20264
+ this.#exports = /* @__PURE__ */ new Set;
20265
+ }
20266
+ this.#exports.add(name.text);
20267
+ }
20268
+ refresh(ambient, hasExport) {
20269
+ this.#ambient = ambient;
20270
+ this.#hasExport = hasExport;
20271
+ }
20272
+ };
20273
+ var RootScope = class extends AbstractScope {
20274
+ #exportAll;
20275
+ #exports = undefined;
20276
+ #innerScope = new NonRootScope(this, 1);
20277
+ constructor(exportAll, global) {
20278
+ super(global);
20279
+ this.#exportAll = exportAll;
20280
+ }
20281
+ addUse(use, origin) {
20282
+ if (origin === this.#innerScope) {
20283
+ return super.addUse(use);
20284
+ }
20285
+ return this.#innerScope.addUse(use);
20286
+ }
20287
+ addVariable(identifier3, name, selector, exported, domain) {
20288
+ if (domain & 8) {
20289
+ return super.addVariable(identifier3, name, selector, exported, domain);
20290
+ }
20291
+ return this.#innerScope.addVariable(identifier3, name, selector, exported, domain);
20292
+ }
20293
+ end(cb) {
20294
+ this.#innerScope.end((value, key) => {
20295
+ value.exported ||= this.#exportAll || this.#exports !== undefined && this.#exports.includes(key.text);
20296
+ value.inGlobalScope = this.global;
20297
+ return cb(value, key, this);
20298
+ });
20299
+ return super.end((value, key, scope) => {
20300
+ value.exported ||= scope === this && this.#exports !== undefined && this.#exports.includes(key.text);
20301
+ return cb(value, key, scope);
20302
+ });
20303
+ }
20304
+ getDestinationScope() {
20305
+ return this;
20306
+ }
20307
+ markExported(id2) {
20308
+ if (this.#exports === undefined) {
20309
+ this.#exports = [id2.text];
20310
+ } else {
20311
+ this.#exports.push(id2.text);
20312
+ }
20313
+ }
20314
+ };
20315
+ function mapDeclaration(declaration) {
20316
+ return {
20317
+ declaration,
20318
+ domain: getDeclarationDomain(declaration),
20319
+ exported: true
20320
+ };
20321
+ }
20322
+ var UsageWalker = class {
20323
+ #result = /* @__PURE__ */ new Map;
20324
+ #scope;
20325
+ getUsage(sourceFile) {
20326
+ const variableCallback = (variable, key) => {
20327
+ this.#result.set(key, variable);
20328
+ };
20329
+ const isModule = ts9.isExternalModule(sourceFile);
20330
+ this.#scope = new RootScope(sourceFile.isDeclarationFile && isModule && !containsExportStatement(sourceFile), !isModule);
20331
+ const cb = (node) => {
20332
+ if (isBlockScopeBoundary(node)) {
20333
+ return continueWithScope(node, new BlockScope(this.#scope.getFunctionScope(), this.#scope), handleBlockScope);
20334
+ }
20335
+ switch (node.kind) {
20336
+ case ts9.SyntaxKind.ArrowFunction:
20337
+ case ts9.SyntaxKind.CallSignature:
20338
+ case ts9.SyntaxKind.Constructor:
20339
+ case ts9.SyntaxKind.ConstructorType:
20340
+ case ts9.SyntaxKind.ConstructSignature:
20341
+ case ts9.SyntaxKind.FunctionDeclaration:
20342
+ case ts9.SyntaxKind.FunctionExpression:
20343
+ case ts9.SyntaxKind.FunctionType:
20344
+ case ts9.SyntaxKind.GetAccessor:
20345
+ case ts9.SyntaxKind.MethodDeclaration:
20346
+ case ts9.SyntaxKind.MethodSignature:
20347
+ case ts9.SyntaxKind.SetAccessor:
20348
+ return this.#handleFunctionLikeDeclaration(node, cb, variableCallback);
20349
+ case ts9.SyntaxKind.ClassDeclaration:
20350
+ this.#handleDeclaration(node, true, 4 | 2);
20351
+ return continueWithScope(node, new NonRootScope(this.#scope, 1));
20352
+ case ts9.SyntaxKind.ClassExpression:
20353
+ return continueWithScope(node, node.name !== undefined ? new ClassExpressionScope(node.name, this.#scope) : new NonRootScope(this.#scope, 1));
20354
+ case ts9.SyntaxKind.ConditionalType:
20355
+ return this.#handleConditionalType(node, cb, variableCallback);
20356
+ case ts9.SyntaxKind.EnumDeclaration:
20357
+ this.#handleDeclaration(node, true, 7);
20358
+ return continueWithScope(node, this.#scope.createOrReuseEnumScope(node.name.text, includesModifier(node.modifiers, ts9.SyntaxKind.ExportKeyword)));
20359
+ case ts9.SyntaxKind.EnumMember:
20360
+ this.#scope.addVariable(getPropertyName(node.name), node.name, 1, true, 4);
20361
+ break;
20362
+ case ts9.SyntaxKind.ExportAssignment:
20363
+ if (node.expression.kind === ts9.SyntaxKind.Identifier) {
20364
+ return this.#scope.markExported(node.expression);
20365
+ }
20366
+ break;
20367
+ case ts9.SyntaxKind.ExportSpecifier:
20368
+ if (node.propertyName !== undefined) {
20369
+ return this.#scope.markExported(node.propertyName, node.name);
20370
+ }
20371
+ return this.#scope.markExported(node.name);
20372
+ case ts9.SyntaxKind.Identifier: {
20373
+ const domain = getUsageDomain(node);
20374
+ if (domain !== undefined) {
20375
+ this.#scope.addUse({ domain, location: node });
20376
+ }
20377
+ return;
20378
+ }
20379
+ case ts9.SyntaxKind.ImportClause:
20380
+ case ts9.SyntaxKind.ImportEqualsDeclaration:
20381
+ case ts9.SyntaxKind.ImportSpecifier:
20382
+ case ts9.SyntaxKind.NamespaceImport:
20383
+ this.#handleDeclaration(node, false, 7 | 8);
20384
+ break;
20385
+ case ts9.SyntaxKind.InterfaceDeclaration:
20386
+ case ts9.SyntaxKind.TypeAliasDeclaration:
20387
+ this.#handleDeclaration(node, true, 2);
20388
+ return continueWithScope(node, new NonRootScope(this.#scope, 4));
20389
+ case ts9.SyntaxKind.MappedType:
20390
+ return continueWithScope(node, new NonRootScope(this.#scope, 4));
20391
+ case ts9.SyntaxKind.ModuleDeclaration:
20392
+ return this.#handleModule(node, continueWithScope);
20393
+ case ts9.SyntaxKind.Parameter:
20394
+ if (node.parent.kind !== ts9.SyntaxKind.IndexSignature && (node.name.kind !== ts9.SyntaxKind.Identifier || identifierToKeywordKind(node.name) !== ts9.SyntaxKind.ThisKeyword)) {
20395
+ this.#handleBindingName(node.name, false, false);
20396
+ }
20397
+ break;
20398
+ case ts9.SyntaxKind.TypeParameter:
20399
+ this.#scope.addVariable(node.name.text, node.name, node.parent.kind === ts9.SyntaxKind.InferType ? 8 : 7, false, 2);
20400
+ break;
20401
+ case ts9.SyntaxKind.VariableDeclarationList:
20402
+ this.#handleVariableDeclaration(node);
20403
+ break;
20404
+ }
20405
+ return ts9.forEachChild(node, cb);
20406
+ };
20407
+ const continueWithScope = (node, scope, next = forEachChild) => {
20408
+ const savedScope = this.#scope;
20409
+ this.#scope = scope;
20410
+ next(node);
20411
+ this.#scope.end(variableCallback);
20412
+ this.#scope = savedScope;
20413
+ };
20414
+ const handleBlockScope = (node) => {
20415
+ if (node.kind === ts9.SyntaxKind.CatchClause && node.variableDeclaration !== undefined) {
20416
+ this.#handleBindingName(node.variableDeclaration.name, true, false);
20417
+ }
20418
+ return ts9.forEachChild(node, cb);
20419
+ };
20420
+ ts9.forEachChild(sourceFile, cb);
20421
+ this.#scope.end(variableCallback);
20422
+ return this.#result;
20423
+ function forEachChild(node) {
20424
+ return ts9.forEachChild(node, cb);
20425
+ }
20426
+ }
20427
+ #handleBindingName(name, blockScoped, exported) {
20428
+ if (name.kind === ts9.SyntaxKind.Identifier) {
20429
+ return this.#scope.addVariable(name.text, name, blockScoped ? 3 : 1, exported, 4);
20430
+ }
20431
+ forEachDestructuringIdentifier(name, (declaration) => {
20432
+ this.#scope.addVariable(declaration.name.text, declaration.name, blockScoped ? 3 : 1, exported, 4);
20433
+ });
20434
+ }
20435
+ #handleConditionalType(node, cb, varCb) {
20436
+ const savedScope = this.#scope;
20437
+ const scope = this.#scope = new ConditionalTypeScope(savedScope);
20438
+ cb(node.checkType);
20439
+ scope.updateState(1);
20440
+ cb(node.extendsType);
20441
+ scope.updateState(2);
20442
+ cb(node.trueType);
20443
+ scope.updateState(3);
20444
+ cb(node.falseType);
20445
+ scope.end(varCb);
20446
+ this.#scope = savedScope;
20447
+ }
20448
+ #handleDeclaration(node, blockScoped, domain) {
20449
+ if (node.name !== undefined) {
20450
+ this.#scope.addVariable(node.name.text, node.name, blockScoped ? 3 : 1, includesModifier(node.modifiers, ts9.SyntaxKind.ExportKeyword), domain);
20451
+ }
20452
+ }
20453
+ #handleFunctionLikeDeclaration(node, cb, varCb) {
20454
+ if (ts9.canHaveDecorators(node)) {
20455
+ ts9.getDecorators(node)?.forEach(cb);
20456
+ }
20457
+ const savedScope = this.#scope;
20458
+ if (node.kind === ts9.SyntaxKind.FunctionDeclaration) {
20459
+ this.#handleDeclaration(node, false, 4);
20460
+ }
20461
+ const scope = this.#scope = node.kind === ts9.SyntaxKind.FunctionExpression && node.name !== undefined ? new FunctionExpressionScope(node.name, savedScope) : new FunctionScope(savedScope);
20462
+ if (node.name !== undefined) {
20463
+ cb(node.name);
20464
+ }
20465
+ if (node.typeParameters !== undefined) {
20466
+ node.typeParameters.forEach(cb);
20467
+ }
20468
+ node.parameters.forEach(cb);
20469
+ if (node.type !== undefined) {
20470
+ cb(node.type);
20471
+ }
20472
+ if (node.body !== undefined) {
20473
+ scope.beginBody();
20474
+ cb(node.body);
20475
+ }
20476
+ scope.end(varCb);
20477
+ this.#scope = savedScope;
20478
+ }
20479
+ #handleModule(node, next) {
20480
+ if (node.flags & ts9.NodeFlags.GlobalAugmentation) {
20481
+ return next(node, this.#scope.createOrReuseNamespaceScope("-global", false, true, false));
20482
+ }
20483
+ if (node.name.kind === ts9.SyntaxKind.Identifier) {
20484
+ const exported = isNamespaceExported(node);
20485
+ this.#scope.addVariable(node.name.text, node.name, 1, exported, 1 | 4);
20486
+ const ambient = includesModifier(node.modifiers, ts9.SyntaxKind.DeclareKeyword);
20487
+ return next(node, this.#scope.createOrReuseNamespaceScope(node.name.text, exported, ambient, ambient && namespaceHasExportStatement(node)));
20488
+ }
20489
+ return next(node, this.#scope.createOrReuseNamespaceScope(`"${node.name.text}"`, false, true, namespaceHasExportStatement(node)));
20490
+ }
20491
+ #handleVariableDeclaration(declarationList) {
20492
+ const blockScoped = isBlockScopedVariableDeclarationList(declarationList);
20493
+ const exported = declarationList.parent.kind === ts9.SyntaxKind.VariableStatement && includesModifier(declarationList.parent.modifiers, ts9.SyntaxKind.ExportKeyword);
20494
+ for (const declaration of declarationList.declarations) {
20495
+ this.#handleBindingName(declaration.name, blockScoped, exported);
20496
+ }
20497
+ }
20498
+ };
20499
+ function containsExportStatement(block) {
20500
+ for (const statement of block.statements) {
20501
+ if (statement.kind === ts9.SyntaxKind.ExportDeclaration || statement.kind === ts9.SyntaxKind.ExportAssignment) {
20502
+ return true;
20503
+ }
20504
+ }
20505
+ return false;
20506
+ }
20507
+ function forEachDestructuringIdentifier(pattern4, fn) {
20508
+ for (const element of pattern4.elements) {
20509
+ if (element.kind !== ts9.SyntaxKind.BindingElement) {
20510
+ continue;
20511
+ }
20512
+ let result;
20513
+ if (element.name.kind === ts9.SyntaxKind.Identifier) {
20514
+ result = fn(element);
20515
+ } else {
20516
+ result = forEachDestructuringIdentifier(element.name, fn);
20517
+ }
20518
+ if (result) {
20519
+ return result;
20520
+ }
20521
+ }
20522
+ }
20523
+ function isBlockScopedVariableDeclarationList(declarationList) {
20524
+ return (declarationList.flags & ts9.NodeFlags.BlockScoped) !== 0;
20525
+ }
20526
+ function isNamespaceExported(node) {
20527
+ return node.parent.kind === ts9.SyntaxKind.ModuleDeclaration || includesModifier(node.modifiers, ts9.SyntaxKind.ExportKeyword);
20528
+ }
20529
+ function namespaceHasExportStatement(ns) {
20530
+ if (ns.body === undefined || ns.body.kind !== ts9.SyntaxKind.ModuleBlock) {
20531
+ return false;
20532
+ }
20533
+ return containsExportStatement(ns.body);
20534
+ }
20535
+
20536
+ // src/rules/prefer-enum-item.ts
20537
+ import { SymbolFlags } from "typescript";
20538
+ function isJSXAttributeValue(node) {
20539
+ const { parent } = node;
20540
+ return parent !== undefined && parent.type === AST_NODE_TYPES7.JSXAttribute && parent.value === node;
20541
+ }
20542
+ function canHaveContextualEnumType(node) {
20543
+ const { parent } = node;
20544
+ if (parent === undefined)
20545
+ return false;
20546
+ switch (parent.type) {
20547
+ case AST_NODE_TYPES7.CallExpression:
20548
+ case AST_NODE_TYPES7.NewExpression:
20549
+ return parent.arguments.includes(node);
20550
+ case AST_NODE_TYPES7.Property:
20551
+ return parent.value === node;
20552
+ case AST_NODE_TYPES7.JSXAttribute:
20553
+ return parent.value === node;
20554
+ case AST_NODE_TYPES7.VariableDeclarator: {
20555
+ if (parent.init !== node)
20556
+ return false;
20557
+ const { id: id2 } = parent;
20558
+ return id2.type === AST_NODE_TYPES7.Identifier && id2.typeAnnotation !== undefined;
20559
+ }
20560
+ default:
20561
+ return false;
20562
+ }
20563
+ }
19756
20564
  var ENUM_PREFIX = "Enum.";
20565
+ var enumLiteralIndexCache = new WeakMap;
19757
20566
  function getFullEnumPath(checker, type3) {
19758
20567
  const symbol3 = type3.getSymbol();
19759
20568
  if (symbol3 === undefined)
@@ -19775,8 +20584,8 @@ function getPropertyLiteralType(checker, type3, propertyName) {
19775
20584
  return;
19776
20585
  }
19777
20586
  function getUnionTypes(type3) {
19778
- if (type3.isUnion())
19779
- return type3.types;
20587
+ if (isUnionType(type3))
20588
+ return unionConstituents(type3);
19780
20589
  return [type3];
19781
20590
  }
19782
20591
  function createEnumMatch(enumPath) {
@@ -19784,14 +20593,153 @@ function createEnumMatch(enumPath) {
19784
20593
  }
19785
20594
  var prefer_enum_item_default = createRule({
19786
20595
  create(context) {
19787
- const [{ fixNumericToValue = false } = {}] = context.options;
20596
+ const [{ fixNumericToValue = false, performanceMode = false } = {}] = context.options;
19788
20597
  const services = ESLintUtils3.getParserServices(context);
19789
20598
  const checker = services.program.getTypeChecker();
20599
+ const unionTypesCache = new WeakMap;
20600
+ const enumPathCache = new WeakMap;
20601
+ const enumItemInfoCache = new WeakMap;
20602
+ const enumLookupCache = new WeakMap;
20603
+ function getUnionTypesCached(type3) {
20604
+ const cached = unionTypesCache.get(type3);
20605
+ if (cached !== undefined)
20606
+ return cached;
20607
+ const resolved = isUnionType(type3) ? unionConstituents(type3) : [type3];
20608
+ unionTypesCache.set(type3, resolved);
20609
+ return resolved;
20610
+ }
20611
+ function getFullEnumPathCached(type3) {
20612
+ const cached = enumPathCache.get(type3);
20613
+ if (cached !== undefined)
20614
+ return cached === false ? undefined : cached;
20615
+ const resolved = getFullEnumPath(checker, type3);
20616
+ enumPathCache.set(type3, resolved ?? false);
20617
+ return resolved;
20618
+ }
20619
+ function getEnumItemInfo(type3) {
20620
+ const cached = enumItemInfoCache.get(type3);
20621
+ if (cached !== undefined)
20622
+ return cached === false ? undefined : cached;
20623
+ const enumPath = getFullEnumPathCached(type3);
20624
+ if (enumPath === undefined) {
20625
+ enumItemInfoCache.set(type3, false);
20626
+ return;
20627
+ }
20628
+ const nameLiteral = getPropertyLiteralType(checker, type3, "Name");
20629
+ const valueLiteral = getPropertyLiteralType(checker, type3, "Value");
20630
+ const info = {
20631
+ enumPath,
20632
+ ...typeof nameLiteral === "string" ? { nameLiteral } : {},
20633
+ ...typeof valueLiteral === "number" ? { valueLiteral } : {}
20634
+ };
20635
+ enumItemInfoCache.set(type3, info);
20636
+ return info;
20637
+ }
20638
+ function getEnumLookup(type3) {
20639
+ const cached = enumLookupCache.get(type3);
20640
+ if (cached !== undefined)
20641
+ return cached === false ? undefined : cached;
20642
+ const unionTypes = getUnionTypesCached(type3);
20643
+ const stringMap = new Map;
20644
+ const numberMap = new Map;
20645
+ let hasAny = false;
20646
+ for (const memberType of unionTypes) {
20647
+ const info = getEnumItemInfo(memberType);
20648
+ if (info === undefined)
20649
+ continue;
20650
+ hasAny = true;
20651
+ if (info.nameLiteral !== undefined && !stringMap.has(info.nameLiteral)) {
20652
+ stringMap.set(info.nameLiteral, info.enumPath);
20653
+ }
20654
+ if (info.valueLiteral !== undefined && !numberMap.has(info.valueLiteral)) {
20655
+ numberMap.set(info.valueLiteral, info.enumPath);
20656
+ }
20657
+ }
20658
+ if (!hasAny) {
20659
+ enumLookupCache.set(type3, false);
20660
+ return;
20661
+ }
20662
+ const lookup = { numberMap, stringMap };
20663
+ enumLookupCache.set(type3, lookup);
20664
+ return lookup;
20665
+ }
20666
+ function resolveAliasSymbol(symbol3) {
20667
+ if ((symbol3.flags & SymbolFlags.Alias) !== 0)
20668
+ return checker.getAliasedSymbol(symbol3);
20669
+ return symbol3;
20670
+ }
20671
+ function buildEnumLiteralIndex(anchorNode) {
20672
+ const resolved = checker.resolveName("Enum", anchorNode, SymbolFlags.Namespace, false);
20673
+ if (resolved === undefined)
20674
+ return;
20675
+ const enumSymbol = resolveAliasSymbol(resolved);
20676
+ if ((enumSymbol.flags & SymbolFlags.Namespace) === 0)
20677
+ return;
20678
+ const stringSet = new Set;
20679
+ const numberSet = new Set;
20680
+ const stack = [enumSymbol];
20681
+ const visited2 = new Set;
20682
+ while (stack.length > 0) {
20683
+ const current = stack.pop();
20684
+ if (current === undefined)
20685
+ continue;
20686
+ if (visited2.has(current))
20687
+ continue;
20688
+ visited2.add(current);
20689
+ const exports = checker.getExportsOfModule(current);
20690
+ for (const exportSymbol of exports) {
20691
+ const unaliased = resolveAliasSymbol(exportSymbol);
20692
+ if ((unaliased.flags & SymbolFlags.Namespace) !== 0) {
20693
+ stack.push(unaliased);
20694
+ continue;
20695
+ }
20696
+ const type3 = checker.getTypeOfSymbol(unaliased);
20697
+ const info = getEnumItemInfo(type3);
20698
+ if (info === undefined)
20699
+ continue;
20700
+ if (info.nameLiteral !== undefined)
20701
+ stringSet.add(info.nameLiteral);
20702
+ if (info.valueLiteral !== undefined)
20703
+ numberSet.add(info.valueLiteral);
20704
+ }
20705
+ }
20706
+ if (stringSet.size === 0 && numberSet.size === 0)
20707
+ return;
20708
+ return { numberSet, stringSet };
20709
+ }
20710
+ function getEnumLiteralIndex(anchorNode) {
20711
+ const cached = enumLiteralIndexCache.get(checker);
20712
+ if (cached !== undefined)
20713
+ return cached === false ? undefined : cached;
20714
+ const built = buildEnumLiteralIndex(anchorNode);
20715
+ enumLiteralIndexCache.set(checker, built ?? false);
20716
+ return built;
20717
+ }
19790
20718
  function getContextualType(node) {
19791
20719
  const tsNode = services.esTreeNodeToTSNodeMap.get(node);
19792
20720
  return checker.getContextualType(tsNode);
19793
20721
  }
20722
+ function shouldSkipLiteral(node, value) {
20723
+ if (!performanceMode)
20724
+ return false;
20725
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
20726
+ if (tsNode === undefined)
20727
+ return false;
20728
+ const index2 = getEnumLiteralIndex(tsNode);
20729
+ if (index2 === undefined)
20730
+ return false;
20731
+ if (typeof value === "string")
20732
+ return !index2.stringSet.has(value);
20733
+ return !index2.numberSet.has(value);
20734
+ }
19794
20735
  function findEnumMatch(contextualType, literalValue) {
20736
+ if (performanceMode) {
20737
+ const lookup = getEnumLookup(contextualType);
20738
+ if (lookup === undefined)
20739
+ return;
20740
+ const enumPath = typeof literalValue === "string" ? lookup.stringMap.get(literalValue) : lookup.numberMap.get(literalValue);
20741
+ return enumPath === undefined ? undefined : createEnumMatch(enumPath);
20742
+ }
19795
20743
  const unionTypes = getUnionTypes(contextualType);
19796
20744
  for (const memberType of unionTypes) {
19797
20745
  const enumPath = getFullEnumPath(checker, memberType);
@@ -19814,6 +20762,10 @@ var prefer_enum_item_default = createRule({
19814
20762
  const { value } = node;
19815
20763
  if (typeof value !== "string" && typeof value !== "number")
19816
20764
  return;
20765
+ if (!canHaveContextualEnumType(node))
20766
+ return;
20767
+ if (shouldSkipLiteral(node, value))
20768
+ return;
19817
20769
  const contextualType = getContextualType(node);
19818
20770
  if (contextualType === undefined)
19819
20771
  return;
@@ -19823,6 +20775,8 @@ var prefer_enum_item_default = createRule({
19823
20775
  const isString = typeof value === "string";
19824
20776
  const displayValue = isString ? `"${value}"` : String(value);
19825
20777
  const fixPath = fixNumericToValue && !isString ? `${match.enumPath}.Value` : match.enumPath;
20778
+ const needsJSXBraces = isJSXAttributeValue(node);
20779
+ const fixText = needsJSXBraces ? `{${fixPath}}` : fixPath;
19826
20780
  context.report({
19827
20781
  data: {
19828
20782
  enumType: match.enumPath.split(".").slice(0, -1).join("."),
@@ -19830,7 +20784,7 @@ var prefer_enum_item_default = createRule({
19830
20784
  value: displayValue
19831
20785
  },
19832
20786
  fix(fixer) {
19833
- return fixer.replaceText(node, fixPath);
20787
+ return fixer.replaceText(node, fixText);
19834
20788
  },
19835
20789
  messageId: "preferEnumItem",
19836
20790
  node
@@ -19838,7 +20792,7 @@ var prefer_enum_item_default = createRule({
19838
20792
  }
19839
20793
  };
19840
20794
  },
19841
- defaultOptions: [{}],
20795
+ defaultOptions: [{ fixNumericToValue: false, performanceMode: false }],
19842
20796
  meta: {
19843
20797
  docs: {
19844
20798
  description: "Enforce using EnumItem values instead of string or number literals."
@@ -19855,6 +20809,11 @@ var prefer_enum_item_default = createRule({
19855
20809
  default: false,
19856
20810
  description: "When true, numeric literals fix to Enum.X.Y.Value instead of Enum.X.Y",
19857
20811
  type: "boolean"
20812
+ },
20813
+ performanceMode: {
20814
+ default: false,
20815
+ description: "When true, uses caching to speed up enum lookups without changing behavior",
20816
+ type: "boolean"
19858
20817
  }
19859
20818
  },
19860
20819
  type: "object"
@@ -19867,7 +20826,7 @@ var prefer_enum_item_default = createRule({
19867
20826
 
19868
20827
  // src/rules/prefer-module-scope-constants.ts
19869
20828
  var import_scope_manager3 = __toESM(require_dist2(), 1);
19870
- import { AST_NODE_TYPES as AST_NODE_TYPES7 } from "@typescript-eslint/utils";
20829
+ import { AST_NODE_TYPES as AST_NODE_TYPES8 } from "@typescript-eslint/utils";
19871
20830
  var SCREAMING_SNAKE_CASE = /^[A-Z][A-Z0-9_]*$/;
19872
20831
  function isTopScope(scope) {
19873
20832
  const { type: type3 } = scope;
@@ -19875,7 +20834,7 @@ function isTopScope(scope) {
19875
20834
  return true;
19876
20835
  if (scope.upper?.type === import_scope_manager3.ScopeType.global) {
19877
20836
  const { block } = scope.upper;
19878
- if (block.type === AST_NODE_TYPES7.Program && block.sourceType === "script")
20837
+ if (block.type === AST_NODE_TYPES8.Program && block.sourceType === "script")
19879
20838
  return true;
19880
20839
  }
19881
20840
  return false;
@@ -19892,7 +20851,7 @@ var prefer_module_scope_constants_default = createRule({
19892
20851
  },
19893
20852
  VariableDeclarator(node) {
19894
20853
  const { id: id2 } = node;
19895
- if (id2.type !== AST_NODE_TYPES7.Identifier || !SCREAMING_SNAKE_CASE.test(id2.name))
20854
+ if (id2.type !== AST_NODE_TYPES8.Identifier || !SCREAMING_SNAKE_CASE.test(id2.name))
19896
20855
  return;
19897
20856
  if (!inConstDeclaration) {
19898
20857
  context.report({
@@ -19927,7 +20886,7 @@ var prefer_module_scope_constants_default = createRule({
19927
20886
  });
19928
20887
 
19929
20888
  // src/rules/prefer-pascal-case-enums.ts
19930
- import { AST_NODE_TYPES as AST_NODE_TYPES8 } from "@typescript-eslint/utils";
20889
+ import { AST_NODE_TYPES as AST_NODE_TYPES9 } from "@typescript-eslint/utils";
19931
20890
 
19932
20891
  // src/utilities/casing-utilities.ts
19933
20892
  var SPLIT_LOWER_TO_UPPER = regex2("([\\p{Ll}\\d])(\\p{Lu})", "gu");
@@ -19967,9 +20926,9 @@ function toPascalCase(value) {
19967
20926
  // src/rules/prefer-pascal-case-enums.ts
19968
20927
  var STARTS_WITH_DIGIT = regex2("^\\d");
19969
20928
  function getIdentifierName(node) {
19970
- if (node.type === AST_NODE_TYPES8.Identifier)
20929
+ if (node.type === AST_NODE_TYPES9.Identifier)
19971
20930
  return node.name;
19972
- if (node.type !== AST_NODE_TYPES8.Literal || typeof node.value !== "string")
20931
+ if (node.type !== AST_NODE_TYPES9.Literal || typeof node.value !== "string")
19973
20932
  return;
19974
20933
  return STARTS_WITH_DIGIT.test(node.value) ? undefined : node.value;
19975
20934
  }
@@ -20012,17 +20971,17 @@ var prefer_pascal_case_enums_default = createRule({
20012
20971
  });
20013
20972
 
20014
20973
  // src/utilities/pattern-replacement/pattern-matcher.ts
20015
- import { AST_NODE_TYPES as AST_NODE_TYPES10 } from "@typescript-eslint/types";
20974
+ import { AST_NODE_TYPES as AST_NODE_TYPES11 } from "@typescript-eslint/types";
20016
20975
 
20017
20976
  // src/utilities/pattern-replacement/constant-folder.ts
20018
- import { AST_NODE_TYPES as AST_NODE_TYPES9 } from "@typescript-eslint/types";
20977
+ import { AST_NODE_TYPES as AST_NODE_TYPES10 } from "@typescript-eslint/types";
20019
20978
  function normalizeZero(num) {
20020
20979
  return Object.is(num, -0) ? 0 : num;
20021
20980
  }
20022
20981
  function unwrap(node) {
20023
20982
  switch (node.type) {
20024
- case AST_NODE_TYPES9.TSAsExpression:
20025
- case AST_NODE_TYPES9.TSNonNullExpression:
20983
+ case AST_NODE_TYPES10.TSAsExpression:
20984
+ case AST_NODE_TYPES10.TSNonNullExpression:
20026
20985
  return unwrap(node.expression);
20027
20986
  default:
20028
20987
  return node;
@@ -20030,10 +20989,10 @@ function unwrap(node) {
20030
20989
  }
20031
20990
  function evaluateConstant(node) {
20032
20991
  const expression = unwrap(node);
20033
- if (expression.type === AST_NODE_TYPES9.Literal && typeof expression.value === "number") {
20992
+ if (expression.type === AST_NODE_TYPES10.Literal && typeof expression.value === "number") {
20034
20993
  return normalizeZero(expression.value);
20035
20994
  }
20036
- if (expression.type === AST_NODE_TYPES9.UnaryExpression) {
20995
+ if (expression.type === AST_NODE_TYPES10.UnaryExpression) {
20037
20996
  const argument = evaluateConstant(expression.argument);
20038
20997
  if (argument === undefined)
20039
20998
  return;
@@ -20046,8 +21005,8 @@ function evaluateConstant(node) {
20046
21005
  return;
20047
21006
  }
20048
21007
  }
20049
- if (expression.type === AST_NODE_TYPES9.BinaryExpression) {
20050
- if (expression.left.type === AST_NODE_TYPES9.PrivateIdentifier)
21008
+ if (expression.type === AST_NODE_TYPES10.BinaryExpression) {
21009
+ if (expression.left.type === AST_NODE_TYPES10.PrivateIdentifier)
20051
21010
  return;
20052
21011
  const left = evaluateConstant(expression.left);
20053
21012
  const right = evaluateConstant(expression.right);
@@ -20090,14 +21049,14 @@ function buildPatternIndex(patterns2) {
20090
21049
  }
20091
21050
  function resolveCallee(node) {
20092
21051
  const callee = unwrap(node.callee);
20093
- if (node.type === AST_NODE_TYPES10.NewExpression && callee.type === AST_NODE_TYPES10.Identifier) {
21052
+ if (node.type === AST_NODE_TYPES11.NewExpression && callee.type === AST_NODE_TYPES11.Identifier) {
20094
21053
  return { kind: "constructor", typeName: callee.name };
20095
21054
  }
20096
- if (node.type === AST_NODE_TYPES10.CallExpression) {
20097
- const member = callee.type === AST_NODE_TYPES10.ChainExpression ? unwrap(callee.expression) : callee;
20098
- if (member.type === AST_NODE_TYPES10.MemberExpression && !member.computed) {
21055
+ if (node.type === AST_NODE_TYPES11.CallExpression) {
21056
+ const member = callee.type === AST_NODE_TYPES11.ChainExpression ? unwrap(callee.expression) : callee;
21057
+ if (member.type === AST_NODE_TYPES11.MemberExpression && !member.computed) {
20099
21058
  const object3 = unwrap(member.object);
20100
- if (object3.type === AST_NODE_TYPES10.Identifier && member.property.type === AST_NODE_TYPES10.Identifier) {
21059
+ if (object3.type === AST_NODE_TYPES11.Identifier && member.property.type === AST_NODE_TYPES11.Identifier) {
20101
21060
  return {
20102
21061
  kind: "staticMethod",
20103
21062
  methodName: member.property.name,
@@ -20114,9 +21073,9 @@ function captureParameter(node, sourceCode) {
20114
21073
  const constValue = evaluateConstant(expression);
20115
21074
  let expressionKey;
20116
21075
  let isComplex = false;
20117
- if (expression.type === AST_NODE_TYPES10.Literal && typeof expression.value === "number") {
21076
+ if (expression.type === AST_NODE_TYPES11.Literal && typeof expression.value === "number") {
20118
21077
  expressionKey = `literal:${normalizeZero(expression.value)}`;
20119
- } else if (expression.type === AST_NODE_TYPES10.Identifier) {
21078
+ } else if (expression.type === AST_NODE_TYPES11.Identifier) {
20120
21079
  if (expression.name === "undefined")
20121
21080
  expressionKey = "undefined";
20122
21081
  else
@@ -20142,7 +21101,7 @@ function matchParameters(patterns2, parameters3, sourceCode) {
20142
21101
  continue;
20143
21102
  const parameter2 = parameters3[index2];
20144
21103
  const unwrappedParameter = parameter2 === undefined ? undefined : unwrap(parameter2);
20145
- const isMissing = parameter2 === undefined || unwrappedParameter?.type === AST_NODE_TYPES10.Identifier && unwrappedParameter.name === "undefined";
21104
+ const isMissing = parameter2 === undefined || unwrappedParameter?.type === AST_NODE_TYPES11.Identifier && unwrappedParameter.name === "undefined";
20146
21105
  if (pattern4.kind === "literal") {
20147
21106
  if (isMissing)
20148
21107
  return;
@@ -20432,13 +21391,13 @@ var prefer_pattern_replacements_default = createRule({
20432
21391
  });
20433
21392
 
20434
21393
  // src/rules/prefer-sequence-overloads.ts
20435
- import { AST_NODE_TYPES as AST_NODE_TYPES11 } from "@typescript-eslint/types";
21394
+ import { AST_NODE_TYPES as AST_NODE_TYPES12 } from "@typescript-eslint/types";
20436
21395
  var sequenceDescriptors = [
20437
21396
  { keypointName: "ColorSequenceKeypoint", sequenceName: "ColorSequence" },
20438
21397
  { keypointName: "NumberSequenceKeypoint", sequenceName: "NumberSequence" }
20439
21398
  ];
20440
21399
  function isSequenceIdentifier(node) {
20441
- if (node.type !== AST_NODE_TYPES11.Identifier)
21400
+ if (node.type !== AST_NODE_TYPES12.Identifier)
20442
21401
  return false;
20443
21402
  for (const { sequenceName } of sequenceDescriptors)
20444
21403
  if (sequenceName === node.name)
@@ -20452,16 +21411,16 @@ function findDescriptor(sequenceName) {
20452
21411
  return;
20453
21412
  }
20454
21413
  var isNumericLiteral = Compile(build_default.Object({
20455
- type: build_default.Literal(AST_NODE_TYPES11.Literal),
21414
+ type: build_default.Literal(AST_NODE_TYPES12.Literal),
20456
21415
  value: build_default.Number()
20457
21416
  }));
20458
21417
  function isExpressionArgument(argument) {
20459
- return argument !== undefined && argument.type !== AST_NODE_TYPES11.SpreadElement;
21418
+ return argument !== undefined && argument.type !== AST_NODE_TYPES12.SpreadElement;
20460
21419
  }
20461
21420
  function extractKeypoint(element, descriptor) {
20462
- if (element === undefined || element.type !== AST_NODE_TYPES11.NewExpression)
21421
+ if (element === undefined || element.type !== AST_NODE_TYPES12.NewExpression)
20463
21422
  return;
20464
- if (element.callee.type !== AST_NODE_TYPES11.Identifier || element.callee.name !== descriptor.keypointName)
21423
+ if (element.callee.type !== AST_NODE_TYPES12.Identifier || element.callee.name !== descriptor.keypointName)
20465
21424
  return;
20466
21425
  if (element.arguments.length !== 2)
20467
21426
  return;
@@ -20487,7 +21446,7 @@ var prefer_sequence_overloads_default = createRule({
20487
21446
  if (descriptor === undefined || node.arguments.length !== 1)
20488
21447
  return;
20489
21448
  const [argument] = node.arguments;
20490
- if (argument === undefined || argument.type !== AST_NODE_TYPES11.ArrayExpression || argument.elements.length !== 2)
21449
+ if (argument === undefined || argument.type !== AST_NODE_TYPES12.ArrayExpression || argument.elements.length !== 2)
20491
21450
  return;
20492
21451
  const firstElement = argument.elements[0] ?? undefined;
20493
21452
  const secondElement = argument.elements[1] ?? undefined;
@@ -20855,16 +21814,16 @@ var preferUDim2Shorthand = {
20855
21814
  var prefer_udim2_shorthand_default = preferUDim2Shorthand;
20856
21815
 
20857
21816
  // src/rules/react-hooks-strict-return.ts
20858
- import { AST_NODE_TYPES as AST_NODE_TYPES12 } from "@typescript-eslint/utils";
21817
+ import { AST_NODE_TYPES as AST_NODE_TYPES13 } from "@typescript-eslint/utils";
20859
21818
  var MAX_RETURN_ELEMENTS = 2;
20860
21819
  var HOOK_PATTERN = /^use[A-Z0-9].*$/;
20861
21820
  function isHookNode(node) {
20862
21821
  let name;
20863
- if (node.type === AST_NODE_TYPES12.VariableDeclarator && node.id.type === AST_NODE_TYPES12.Identifier) {
21822
+ if (node.type === AST_NODE_TYPES13.VariableDeclarator && node.id.type === AST_NODE_TYPES13.Identifier) {
20864
21823
  ({ name } = node.id);
20865
- } else if (node.type === AST_NODE_TYPES12.FunctionDeclaration && node.id)
21824
+ } else if (node.type === AST_NODE_TYPES13.FunctionDeclaration && node.id)
20866
21825
  ({ name } = node.id);
20867
- else if (node.type === AST_NODE_TYPES12.FunctionExpression && node.id)
21826
+ else if (node.type === AST_NODE_TYPES13.FunctionExpression && node.id)
20868
21827
  ({ name } = node.id);
20869
21828
  return name !== undefined && HOOK_PATTERN.test(name);
20870
21829
  }
@@ -20888,27 +21847,27 @@ function getArrayElementsFromVariable(scope, name) {
20888
21847
  if (!identifier3.parent)
20889
21848
  continue;
20890
21849
  const { parent } = identifier3;
20891
- if (parent.type !== AST_NODE_TYPES12.VariableDeclarator)
21850
+ if (parent.type !== AST_NODE_TYPES13.VariableDeclarator)
20892
21851
  continue;
20893
- if (!parent.init || parent.init.type !== AST_NODE_TYPES12.ArrayExpression)
21852
+ if (!parent.init || parent.init.type !== AST_NODE_TYPES13.ArrayExpression)
20894
21853
  continue;
20895
21854
  elements.push(...parent.init.elements);
20896
21855
  }
20897
21856
  return elements;
20898
21857
  }
20899
21858
  function countReturnElements(argument, scope) {
20900
- if (argument.type === AST_NODE_TYPES12.Identifier)
21859
+ if (argument.type === AST_NODE_TYPES13.Identifier)
20901
21860
  return getArrayElementsFromVariable(scope, argument.name).length;
20902
- if (argument.type !== AST_NODE_TYPES12.ArrayExpression)
21861
+ if (argument.type !== AST_NODE_TYPES13.ArrayExpression)
20903
21862
  return 0;
20904
21863
  let count = 0;
20905
21864
  for (const element of argument.elements) {
20906
21865
  if (element === null)
20907
21866
  count += 1;
20908
- else if (element.type === AST_NODE_TYPES12.SpreadElement) {
20909
- if (element.argument.type === AST_NODE_TYPES12.Identifier) {
21867
+ else if (element.type === AST_NODE_TYPES13.SpreadElement) {
21868
+ if (element.argument.type === AST_NODE_TYPES13.Identifier) {
20910
21869
  count += getArrayElementsFromVariable(scope, element.argument.name).length;
20911
- } else if (element.argument.type === AST_NODE_TYPES12.ArrayExpression) {
21870
+ } else if (element.argument.type === AST_NODE_TYPES13.ArrayExpression) {
20912
21871
  count += element.argument.elements.length;
20913
21872
  } else
20914
21873
  count += 1;
@@ -20921,14 +21880,14 @@ function exceedsMaxReturnProperties(node, scope) {
20921
21880
  const { argument } = node;
20922
21881
  if (argument === null)
20923
21882
  return false;
20924
- if (argument.type === AST_NODE_TYPES12.ObjectExpression)
21883
+ if (argument.type === AST_NODE_TYPES13.ObjectExpression)
20925
21884
  return false;
20926
- if (argument.type === AST_NODE_TYPES12.Identifier) {
21885
+ if (argument.type === AST_NODE_TYPES13.Identifier) {
20927
21886
  const variable = getVariableByName(scope, argument.name);
20928
21887
  if (variable) {
20929
21888
  for (const { identifier: identifier3 } of variable.references) {
20930
21889
  const { parent } = identifier3;
20931
- if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.init?.type === AST_NODE_TYPES12.ObjectExpression) {
21890
+ if (parent?.type === AST_NODE_TYPES13.VariableDeclarator && parent.init?.type === AST_NODE_TYPES13.ObjectExpression) {
20932
21891
  return false;
20933
21892
  }
20934
21893
  }
@@ -20950,13 +21909,13 @@ var react_hooks_strict_return_default = createRule({
20950
21909
  return {
20951
21910
  ArrowFunctionExpression(node) {
20952
21911
  const { parent } = node;
20953
- if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.id.type === AST_NODE_TYPES12.Identifier && HOOK_PATTERN.test(parent.id.name)) {
21912
+ if (parent?.type === AST_NODE_TYPES13.VariableDeclarator && parent.id.type === AST_NODE_TYPES13.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20954
21913
  hookDepth += 1;
20955
21914
  }
20956
21915
  },
20957
21916
  "ArrowFunctionExpression:exit"(node) {
20958
21917
  const { parent } = node;
20959
- if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.id.type === AST_NODE_TYPES12.Identifier && HOOK_PATTERN.test(parent.id.name)) {
21918
+ if (parent?.type === AST_NODE_TYPES13.VariableDeclarator && parent.id.type === AST_NODE_TYPES13.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20960
21919
  hookDepth -= 1;
20961
21920
  }
20962
21921
  },
@@ -21348,7 +22307,7 @@ var requireNamedEffectFunctions = {
21348
22307
  var require_named_effect_functions_default = requireNamedEffectFunctions;
21349
22308
 
21350
22309
  // src/rules/require-paired-calls.ts
21351
- import { AST_NODE_TYPES as AST_NODE_TYPES13 } from "@typescript-eslint/types";
22310
+ import { AST_NODE_TYPES as AST_NODE_TYPES14 } from "@typescript-eslint/types";
21352
22311
  var isStringArray = Compile(build_default.Readonly(build_default.Array(build_default.String())));
21353
22312
  var isPairConfiguration = Compile(build_default.Readonly(build_default.Object({
21354
22313
  alternatives: build_default.Optional(isStringArray),
@@ -21366,20 +22325,20 @@ var isRuleOptions4 = Compile(build_default.Partial(build_default.Readonly(build_
21366
22325
  pairs: build_default.Readonly(build_default.Array(isPairConfiguration))
21367
22326
  }))));
21368
22327
  var LOOP_NODE_TYPES = new Set([
21369
- AST_NODE_TYPES13.DoWhileStatement,
21370
- AST_NODE_TYPES13.ForInStatement,
21371
- AST_NODE_TYPES13.ForOfStatement,
21372
- AST_NODE_TYPES13.ForStatement,
21373
- AST_NODE_TYPES13.WhileStatement
22328
+ AST_NODE_TYPES14.DoWhileStatement,
22329
+ AST_NODE_TYPES14.ForInStatement,
22330
+ AST_NODE_TYPES14.ForOfStatement,
22331
+ AST_NODE_TYPES14.ForStatement,
22332
+ AST_NODE_TYPES14.WhileStatement
21374
22333
  ]);
21375
22334
  var DEFAULT_ROBLOX_YIELDING_FUNCTIONS = ["task.wait", "wait", "*.WaitForChild", "*.*Async"];
21376
22335
  function getCallName(node) {
21377
22336
  const { callee } = node;
21378
- if (callee.type === AST_NODE_TYPES13.Identifier)
22337
+ if (callee.type === AST_NODE_TYPES14.Identifier)
21379
22338
  return callee.name;
21380
- if (callee.type === AST_NODE_TYPES13.MemberExpression) {
21381
- const object3 = callee.object.type === AST_NODE_TYPES13.Identifier ? callee.object.name : undefined;
21382
- const property = callee.property.type === AST_NODE_TYPES13.Identifier ? callee.property.name : undefined;
22339
+ if (callee.type === AST_NODE_TYPES14.MemberExpression) {
22340
+ const object3 = callee.object.type === AST_NODE_TYPES14.Identifier ? callee.object.name : undefined;
22341
+ const property = callee.property.type === AST_NODE_TYPES14.Identifier ? callee.property.name : undefined;
21383
22342
  if (object3 !== undefined && property !== undefined)
21384
22343
  return `${object3}.${property}`;
21385
22344
  }
@@ -21415,12 +22374,12 @@ function isLoopLikeStatement(node) {
21415
22374
  return LOOP_NODE_TYPES.has(node.type);
21416
22375
  }
21417
22376
  function isSwitchStatement(node) {
21418
- return node?.type === AST_NODE_TYPES13.SwitchStatement;
22377
+ return node?.type === AST_NODE_TYPES14.SwitchStatement;
21419
22378
  }
21420
22379
  function findLabeledStatementBody(label, startingNode) {
21421
22380
  let current = startingNode;
21422
22381
  while (current) {
21423
- if (current.type === AST_NODE_TYPES13.LabeledStatement && current.label.name === label.name)
22382
+ if (current.type === AST_NODE_TYPES14.LabeledStatement && current.label.name === label.name)
21424
22383
  return current.body;
21425
22384
  current = current.parent ?? undefined;
21426
22385
  }
@@ -21682,7 +22641,7 @@ var rule = {
21682
22641
  function onIfConsequentExit(node) {
21683
22642
  const consequentNode = node;
21684
22643
  const { parent } = consequentNode;
21685
- if (parent?.type === AST_NODE_TYPES13.IfStatement) {
22644
+ if (parent?.type === AST_NODE_TYPES14.IfStatement) {
21686
22645
  const branches = branchStacks.get(parent) ?? [];
21687
22646
  branches.push(cloneStack());
21688
22647
  branchStacks.set(parent, branches);
@@ -21697,7 +22656,7 @@ var rule = {
21697
22656
  function onIfAlternateExit(node) {
21698
22657
  const alternateNode = node;
21699
22658
  const { parent } = alternateNode;
21700
- if (parent?.type === AST_NODE_TYPES13.IfStatement) {
22659
+ if (parent?.type === AST_NODE_TYPES14.IfStatement) {
21701
22660
  const branches = branchStacks.get(parent) ?? [];
21702
22661
  branches.push(cloneStack());
21703
22662
  branchStacks.set(parent, branches);
@@ -21746,7 +22705,7 @@ var rule = {
21746
22705
  function onTryBlockExit(node) {
21747
22706
  const blockNode = node;
21748
22707
  const { parent } = blockNode;
21749
- if (parent?.type === AST_NODE_TYPES13.TryStatement) {
22708
+ if (parent?.type === AST_NODE_TYPES14.TryStatement) {
21750
22709
  const branches = branchStacks.get(parent) ?? [];
21751
22710
  branches.push(cloneStack());
21752
22711
  branchStacks.set(parent, branches);
@@ -21765,7 +22724,7 @@ var rule = {
21765
22724
  function onCatchClauseExit(node) {
21766
22725
  const catchNode = node;
21767
22726
  const { parent } = catchNode;
21768
- if (parent?.type === AST_NODE_TYPES13.TryStatement) {
22727
+ if (parent?.type === AST_NODE_TYPES14.TryStatement) {
21769
22728
  const branches = branchStacks.get(parent) ?? [];
21770
22729
  branches.push(cloneStack());
21771
22730
  branchStacks.set(parent, branches);
@@ -21828,7 +22787,7 @@ var rule = {
21828
22787
  function onSwitchCaseExit(node) {
21829
22788
  const caseNode = node;
21830
22789
  const { parent } = caseNode;
21831
- if (parent?.type === AST_NODE_TYPES13.SwitchStatement) {
22790
+ if (parent?.type === AST_NODE_TYPES14.SwitchStatement) {
21832
22791
  const branches = branchStacks.get(parent) ?? [];
21833
22792
  branches.push(cloneStack());
21834
22793
  branchStacks.set(parent, branches);
@@ -21859,7 +22818,7 @@ var rule = {
21859
22818
  for (const { opener, config, node: node2 } of openerStack) {
21860
22819
  const validClosers = getValidClosers(config);
21861
22820
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
21862
- const statementType = statementNode.type === AST_NODE_TYPES13.ReturnStatement ? "return" : "throw";
22821
+ const statementType = statementNode.type === AST_NODE_TYPES14.ReturnStatement ? "return" : "throw";
21863
22822
  const lineNumber = statementNode.loc?.start.line ?? 0;
21864
22823
  context.report({
21865
22824
  data: {
@@ -21876,7 +22835,7 @@ var rule = {
21876
22835
  const statementNode = node;
21877
22836
  if (openerStack.length === 0)
21878
22837
  return;
21879
- const targetLoop = statementNode.type === AST_NODE_TYPES13.ContinueStatement ? resolveContinueTargetLoop(statementNode) : resolveBreakTargetLoop(statementNode);
22838
+ const targetLoop = statementNode.type === AST_NODE_TYPES14.ContinueStatement ? resolveContinueTargetLoop(statementNode) : resolveBreakTargetLoop(statementNode);
21880
22839
  if (!targetLoop)
21881
22840
  return;
21882
22841
  for (const { node: openerNode, config, opener, loopAncestors } of openerStack) {
@@ -21884,7 +22843,7 @@ var rule = {
21884
22843
  continue;
21885
22844
  const validClosers = getValidClosers(config);
21886
22845
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
21887
- const statementType = statementNode.type === AST_NODE_TYPES13.BreakStatement ? "break" : "continue";
22846
+ const statementType = statementNode.type === AST_NODE_TYPES14.BreakStatement ? "break" : "continue";
21888
22847
  const lineNumber = statementNode.loc?.start.line ?? 0;
21889
22848
  context.report({
21890
22849
  data: {
@@ -22022,7 +22981,7 @@ var rule = {
22022
22981
  continue;
22023
22982
  const validClosers = getValidClosers(config);
22024
22983
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
22025
- const asyncType = asyncNode.type === AST_NODE_TYPES13.AwaitExpression ? "await" : "yield";
22984
+ const asyncType = asyncNode.type === AST_NODE_TYPES14.AwaitExpression ? "await" : "yield";
22026
22985
  context.report({
22027
22986
  data: { asyncType, closer, opener },
22028
22987
  messageId: "asyncViolation",
@@ -24117,4 +25076,4 @@ export {
24117
25076
  createBanInstancesOptions
24118
25077
  };
24119
25078
 
24120
- //# debugId=82B8719F042D688964756E2164756E21
25079
+ //# debugId=A96F64DDBF4FBDA864756E2164756E21