@elizaos/config 1.7.1-alpha.1 → 1.7.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +244 -148
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7625,7 +7625,7 @@ var require_Referencer = __commonJS((exports) => {
|
|
|
7625
7625
|
this.visitForIn(node);
|
|
7626
7626
|
}
|
|
7627
7627
|
ForStatement(node) {
|
|
7628
|
-
if (node.init
|
|
7628
|
+
if (node.init?.type === types_1.AST_NODE_TYPES.VariableDeclaration && node.init.kind !== "var") {
|
|
7629
7629
|
this.scopeManager.nestForScope(node);
|
|
7630
7630
|
}
|
|
7631
7631
|
this.visitChildren(node);
|
|
@@ -179888,7 +179888,12 @@ var require_getParsedConfigFile = __commonJS((exports) => {
|
|
|
179888
179888
|
useCaseSensitiveFileNames: tsserver.sys.useCaseSensitiveFileNames
|
|
179889
179889
|
});
|
|
179890
179890
|
if (parsed?.errors.length) {
|
|
179891
|
-
throw new Error(
|
|
179891
|
+
throw new Error([
|
|
179892
|
+
"Unable to parse the specified 'tsconfig' file. Ensure it's correct and has valid syntax.",
|
|
179893
|
+
formatDiagnostics(parsed.errors)
|
|
179894
|
+
].join(`
|
|
179895
|
+
|
|
179896
|
+
`));
|
|
179892
179897
|
}
|
|
179893
179898
|
return parsed;
|
|
179894
179899
|
function getCurrentDirectory() {
|
|
@@ -183830,7 +183835,7 @@ var require_convert = __commonJS((exports) => {
|
|
|
183830
183835
|
this.#checkForStatementDeclaration(node.initializer, node.kind);
|
|
183831
183836
|
return this.createNode(node, {
|
|
183832
183837
|
type: ts_estree_1.AST_NODE_TYPES.ForOfStatement,
|
|
183833
|
-
await:
|
|
183838
|
+
await: node.awaitModifier?.kind === SyntaxKind.AwaitKeyword,
|
|
183834
183839
|
body: this.convertChild(node.statement),
|
|
183835
183840
|
left: this.convertPattern(node.initializer),
|
|
183836
183841
|
right: this.convertChild(node.expression)
|
|
@@ -183866,77 +183871,73 @@ var require_convert = __commonJS((exports) => {
|
|
|
183866
183871
|
return this.fixExports(node, result);
|
|
183867
183872
|
}
|
|
183868
183873
|
case SyntaxKind.VariableDeclaration: {
|
|
183869
|
-
const
|
|
183870
|
-
if (
|
|
183874
|
+
const hasExclamationToken = !!node.exclamationToken;
|
|
183875
|
+
if (hasExclamationToken) {
|
|
183871
183876
|
if (node.initializer) {
|
|
183872
183877
|
this.#throwError(node, "Declarations with initializers cannot also have definite assignment assertions.");
|
|
183873
183878
|
} else if (node.name.kind !== SyntaxKind.Identifier || !node.type) {
|
|
183874
183879
|
this.#throwError(node, "Declarations with definite assignment assertions must also have type annotations.");
|
|
183875
183880
|
}
|
|
183876
183881
|
}
|
|
183882
|
+
if (node.parent.kind === SyntaxKind.VariableDeclarationList) {
|
|
183883
|
+
const variableDeclarationList = node.parent;
|
|
183884
|
+
const kind = (0, node_utils_1.getDeclarationKind)(variableDeclarationList);
|
|
183885
|
+
if ((variableDeclarationList.parent.kind === SyntaxKind.ForInStatement || variableDeclarationList.parent.kind === SyntaxKind.ForStatement) && (kind === "using" || kind === "await using")) {
|
|
183886
|
+
if (!node.initializer) {
|
|
183887
|
+
this.#throwError(node, `'${kind}' declarations may not be initialized in for statement.`);
|
|
183888
|
+
}
|
|
183889
|
+
if (node.name.kind !== SyntaxKind.Identifier) {
|
|
183890
|
+
this.#throwError(node.name, `'${kind}' declarations may not have binding patterns.`);
|
|
183891
|
+
}
|
|
183892
|
+
}
|
|
183893
|
+
if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
|
|
183894
|
+
const variableStatement = variableDeclarationList.parent;
|
|
183895
|
+
if (kind === "using" || kind === "await using") {
|
|
183896
|
+
if (!node.initializer) {
|
|
183897
|
+
this.#throwError(node, `'${kind}' declarations must be initialized.`);
|
|
183898
|
+
}
|
|
183899
|
+
if (node.name.kind !== SyntaxKind.Identifier) {
|
|
183900
|
+
this.#throwError(node.name, `'${kind}' declarations may not have binding patterns.`);
|
|
183901
|
+
}
|
|
183902
|
+
}
|
|
183903
|
+
const hasDeclareKeyword = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, variableStatement);
|
|
183904
|
+
if ((hasDeclareKeyword || ["await using", "const", "using"].includes(kind)) && hasExclamationToken) {
|
|
183905
|
+
this.#throwError(node, `A definite assignment assertion '!' is not permitted in this context.`);
|
|
183906
|
+
}
|
|
183907
|
+
if (hasDeclareKeyword && node.initializer && (["let", "var"].includes(kind) || node.type)) {
|
|
183908
|
+
this.#throwError(node, `Initializers are not permitted in ambient contexts.`);
|
|
183909
|
+
}
|
|
183910
|
+
}
|
|
183911
|
+
}
|
|
183877
183912
|
const init = this.convertChild(node.initializer);
|
|
183878
183913
|
const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node);
|
|
183879
183914
|
return this.createNode(node, {
|
|
183880
183915
|
type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator,
|
|
183881
|
-
definite,
|
|
183916
|
+
definite: hasExclamationToken,
|
|
183882
183917
|
id,
|
|
183883
183918
|
init
|
|
183884
183919
|
});
|
|
183885
183920
|
}
|
|
183886
183921
|
case SyntaxKind.VariableStatement: {
|
|
183922
|
+
const declarations = node.declarationList.declarations;
|
|
183923
|
+
if (!declarations.length) {
|
|
183924
|
+
this.#throwError(node, "A variable declaration list must have at least one variable declarator.");
|
|
183925
|
+
}
|
|
183887
183926
|
const result = this.createNode(node, {
|
|
183888
183927
|
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
183889
|
-
declarations: this.convertChildren(
|
|
183928
|
+
declarations: this.convertChildren(declarations),
|
|
183890
183929
|
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
183891
183930
|
kind: (0, node_utils_1.getDeclarationKind)(node.declarationList)
|
|
183892
183931
|
});
|
|
183893
|
-
if (!result.declarations.length) {
|
|
183894
|
-
this.#throwError(node, "A variable declaration list must have at least one variable declarator.");
|
|
183895
|
-
}
|
|
183896
|
-
if (result.kind === "using" || result.kind === "await using") {
|
|
183897
|
-
node.declarationList.declarations.forEach((declaration, i) => {
|
|
183898
|
-
if (result.declarations[i].init == null) {
|
|
183899
|
-
this.#throwError(declaration, `'${result.kind}' declarations must be initialized.`);
|
|
183900
|
-
}
|
|
183901
|
-
if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) {
|
|
183902
|
-
this.#throwError(declaration.name, `'${result.kind}' declarations may not have binding patterns.`);
|
|
183903
|
-
}
|
|
183904
|
-
});
|
|
183905
|
-
}
|
|
183906
|
-
if (result.declare || ["await using", "const", "using"].includes(result.kind)) {
|
|
183907
|
-
node.declarationList.declarations.forEach((declaration, i) => {
|
|
183908
|
-
if (result.declarations[i].definite) {
|
|
183909
|
-
this.#throwError(declaration, `A definite assignment assertion '!' is not permitted in this context.`);
|
|
183910
|
-
}
|
|
183911
|
-
});
|
|
183912
|
-
}
|
|
183913
|
-
if (result.declare) {
|
|
183914
|
-
node.declarationList.declarations.forEach((declaration, i) => {
|
|
183915
|
-
if (result.declarations[i].init && (["let", "var"].includes(result.kind) || result.declarations[i].id.typeAnnotation)) {
|
|
183916
|
-
this.#throwError(declaration, `Initializers are not permitted in ambient contexts.`);
|
|
183917
|
-
}
|
|
183918
|
-
});
|
|
183919
|
-
}
|
|
183920
183932
|
return this.fixExports(node, result);
|
|
183921
183933
|
}
|
|
183922
183934
|
case SyntaxKind.VariableDeclarationList: {
|
|
183923
|
-
|
|
183935
|
+
return this.createNode(node, {
|
|
183924
183936
|
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
183925
183937
|
declarations: this.convertChildren(node.declarations),
|
|
183926
183938
|
declare: false,
|
|
183927
183939
|
kind: (0, node_utils_1.getDeclarationKind)(node)
|
|
183928
183940
|
});
|
|
183929
|
-
if (result.kind === "using" || result.kind === "await using") {
|
|
183930
|
-
node.declarations.forEach((declaration, i) => {
|
|
183931
|
-
if (result.declarations[i].init != null) {
|
|
183932
|
-
this.#throwError(declaration, `'${result.kind}' declarations may not be initialized in for statement.`);
|
|
183933
|
-
}
|
|
183934
|
-
if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) {
|
|
183935
|
-
this.#throwError(declaration.name, `'${result.kind}' declarations may not have binding patterns.`);
|
|
183936
|
-
}
|
|
183937
|
-
});
|
|
183938
|
-
}
|
|
183939
|
-
return result;
|
|
183940
183941
|
}
|
|
183941
183942
|
case SyntaxKind.ExpressionStatement:
|
|
183942
183943
|
return this.createNode(node, {
|
|
@@ -184272,7 +184273,7 @@ var require_convert = __commonJS((exports) => {
|
|
|
184272
184273
|
} else {
|
|
184273
184274
|
result = this.createNode(node, {
|
|
184274
184275
|
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
184275
|
-
computed:
|
|
184276
|
+
computed: node.propertyName?.kind === SyntaxKind.ComputedPropertyName,
|
|
184276
184277
|
key: this.convertChild(node.propertyName ?? node.name),
|
|
184277
184278
|
kind: "init",
|
|
184278
184279
|
method: false,
|
|
@@ -185598,10 +185599,15 @@ var require_lib4 = __commonJS((exports) => {
|
|
|
185598
185599
|
}
|
|
185599
185600
|
var ts9__default = /* @__PURE__ */ _interopDefault(ts9);
|
|
185600
185601
|
function forEachToken(node, callback, sourceFile = node.getSourceFile()) {
|
|
185602
|
+
for (const token of iterateTokens(node, sourceFile)) {
|
|
185603
|
+
callback(token);
|
|
185604
|
+
}
|
|
185605
|
+
}
|
|
185606
|
+
function* iterateTokens(node, sourceFile = node.getSourceFile()) {
|
|
185601
185607
|
const queue = [];
|
|
185602
185608
|
while (true) {
|
|
185603
185609
|
if (ts9__default.default.isTokenKind(node.kind)) {
|
|
185604
|
-
|
|
185610
|
+
yield node;
|
|
185605
185611
|
} else {
|
|
185606
185612
|
const children = node.getChildren(sourceFile);
|
|
185607
185613
|
if (children.length === 1) {
|
|
@@ -185619,21 +185625,28 @@ var require_lib4 = __commonJS((exports) => {
|
|
|
185619
185625
|
}
|
|
185620
185626
|
}
|
|
185621
185627
|
function forEachComment(node, callback, sourceFile = node.getSourceFile()) {
|
|
185628
|
+
const fullText = sourceFile.text;
|
|
185629
|
+
for (const { end, kind, pos } of iterateComments(node, sourceFile)) {
|
|
185630
|
+
callback(fullText, { end, kind, pos });
|
|
185631
|
+
}
|
|
185632
|
+
}
|
|
185633
|
+
function* iterateComments(node, sourceFile = node.getSourceFile()) {
|
|
185622
185634
|
const fullText = sourceFile.text;
|
|
185623
185635
|
const notJsx = sourceFile.languageVariant !== ts9__default.default.LanguageVariant.JSX;
|
|
185624
|
-
|
|
185636
|
+
for (const token of iterateTokens(node, sourceFile)) {
|
|
185625
185637
|
if (token.pos === token.end) {
|
|
185626
|
-
|
|
185638
|
+
continue;
|
|
185627
185639
|
}
|
|
185628
185640
|
if (token.kind !== ts9__default.default.SyntaxKind.JsxText) {
|
|
185629
|
-
|
|
185641
|
+
yield* collectComments((callback) => {
|
|
185642
|
+
ts9__default.default.forEachLeadingCommentRange(fullText, token.pos === 0 ? (ts9__default.default.getShebang(fullText) ?? "").length : token.pos, callback);
|
|
185643
|
+
}, fullText);
|
|
185630
185644
|
}
|
|
185631
185645
|
if (notJsx || canHaveTrailingTrivia(token)) {
|
|
185632
|
-
|
|
185646
|
+
yield* collectComments((callback) => {
|
|
185647
|
+
ts9__default.default.forEachTrailingCommentRange(fullText, token.end, callback);
|
|
185648
|
+
}, fullText);
|
|
185633
185649
|
}
|
|
185634
|
-
}, sourceFile);
|
|
185635
|
-
function commentCallback(pos, end, kind) {
|
|
185636
|
-
callback(fullText, { end, kind, pos });
|
|
185637
185650
|
}
|
|
185638
185651
|
}
|
|
185639
185652
|
function canHaveTrailingTrivia(token) {
|
|
@@ -185655,6 +185668,15 @@ var require_lib4 = __commonJS((exports) => {
|
|
|
185655
185668
|
}
|
|
185656
185669
|
return true;
|
|
185657
185670
|
}
|
|
185671
|
+
function collectComments(execute, fullText) {
|
|
185672
|
+
const comments = [];
|
|
185673
|
+
execute((pos, end, kind) => {
|
|
185674
|
+
const text = fullText.slice(pos, end);
|
|
185675
|
+
const value = text.slice(2, kind === ts9__default.default.SyntaxKind.SingleLineCommentTrivia ? undefined : -2);
|
|
185676
|
+
comments.push({ end, kind, pos, text, value });
|
|
185677
|
+
});
|
|
185678
|
+
return comments;
|
|
185679
|
+
}
|
|
185658
185680
|
function isJsxElementOrFragment(node) {
|
|
185659
185681
|
return node.kind === ts9__default.default.SyntaxKind.JsxElement || node.kind === ts9__default.default.SyntaxKind.JsxFragment;
|
|
185660
185682
|
}
|
|
@@ -186514,7 +186536,7 @@ var require_lib4 = __commonJS((exports) => {
|
|
|
186514
186536
|
if (propertySymbol === undefined || !("links" in propertySymbol)) {
|
|
186515
186537
|
return false;
|
|
186516
186538
|
}
|
|
186517
|
-
return isTransientSymbolLinksFlagSet(propertySymbol.links, ts9__default.default.CheckFlags.Readonly);
|
|
186539
|
+
return !!propertySymbol.links && isTransientSymbolLinksFlagSet(propertySymbol.links, ts9__default.default.CheckFlags.Readonly);
|
|
186518
186540
|
}
|
|
186519
186541
|
case ts9__default.default.SyntaxKind.PrefixUnaryExpression:
|
|
186520
186542
|
if (current.kind !== ts9__default.default.SyntaxKind.NumericLiteral) {
|
|
@@ -187599,6 +187621,8 @@ var require_lib4 = __commonJS((exports) => {
|
|
|
187599
187621
|
exports.isValidPropertyAccess = isValidPropertyAccess;
|
|
187600
187622
|
exports.isVariableLikeDeclaration = isVariableLikeDeclaration;
|
|
187601
187623
|
exports.isVoidKeyword = isVoidKeyword;
|
|
187624
|
+
exports.iterateComments = iterateComments;
|
|
187625
|
+
exports.iterateTokens = iterateTokens;
|
|
187602
187626
|
exports.symbolHasReadonlyDeclaration = symbolHasReadonlyDeclaration;
|
|
187603
187627
|
exports.typeConstituents = typeConstituents;
|
|
187604
187628
|
exports.typeIsLiteral = typeIsLiteral;
|
|
@@ -191108,7 +191132,7 @@ var require_resolveProjectList = __commonJS((exports) => {
|
|
|
191108
191132
|
var require_package2 = __commonJS((exports, module) => {
|
|
191109
191133
|
module.exports = {
|
|
191110
191134
|
name: "@typescript-eslint/typescript-estree",
|
|
191111
|
-
version: "8.
|
|
191135
|
+
version: "8.51.0",
|
|
191112
191136
|
description: "A parser that converts TypeScript source code into an ESTree compatible form",
|
|
191113
191137
|
files: [
|
|
191114
191138
|
"dist",
|
|
@@ -191160,15 +191184,15 @@ var require_package2 = __commonJS((exports, module) => {
|
|
|
191160
191184
|
typecheck: "yarn run -BT nx typecheck"
|
|
191161
191185
|
},
|
|
191162
191186
|
dependencies: {
|
|
191163
|
-
"@typescript-eslint/project-service": "8.
|
|
191164
|
-
"@typescript-eslint/tsconfig-utils": "8.
|
|
191165
|
-
"@typescript-eslint/types": "8.
|
|
191166
|
-
"@typescript-eslint/visitor-keys": "8.
|
|
191187
|
+
"@typescript-eslint/project-service": "8.51.0",
|
|
191188
|
+
"@typescript-eslint/tsconfig-utils": "8.51.0",
|
|
191189
|
+
"@typescript-eslint/types": "8.51.0",
|
|
191190
|
+
"@typescript-eslint/visitor-keys": "8.51.0",
|
|
191167
191191
|
debug: "^4.3.4",
|
|
191168
191192
|
minimatch: "^9.0.4",
|
|
191169
191193
|
semver: "^7.6.0",
|
|
191170
191194
|
tinyglobby: "^0.2.15",
|
|
191171
|
-
"ts-api-utils": "^2.
|
|
191195
|
+
"ts-api-utils": "^2.2.0"
|
|
191172
191196
|
},
|
|
191173
191197
|
devDependencies: {
|
|
191174
191198
|
"@vitest/coverage-v8": "^3.1.3",
|
|
@@ -193564,7 +193588,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
193564
193588
|
var require_package3 = __commonJS((exports, module) => {
|
|
193565
193589
|
module.exports = {
|
|
193566
193590
|
name: "@typescript-eslint/parser",
|
|
193567
|
-
version: "8.
|
|
193591
|
+
version: "8.51.0",
|
|
193568
193592
|
description: "An ESLint custom parser which leverages TypeScript ESTree",
|
|
193569
193593
|
files: [
|
|
193570
193594
|
"dist",
|
|
@@ -193615,10 +193639,10 @@ var require_package3 = __commonJS((exports, module) => {
|
|
|
193615
193639
|
typescript: ">=4.8.4 <6.0.0"
|
|
193616
193640
|
},
|
|
193617
193641
|
dependencies: {
|
|
193618
|
-
"@typescript-eslint/scope-manager": "8.
|
|
193619
|
-
"@typescript-eslint/types": "8.
|
|
193620
|
-
"@typescript-eslint/typescript-estree": "8.
|
|
193621
|
-
"@typescript-eslint/visitor-keys": "8.
|
|
193642
|
+
"@typescript-eslint/scope-manager": "8.51.0",
|
|
193643
|
+
"@typescript-eslint/types": "8.51.0",
|
|
193644
|
+
"@typescript-eslint/typescript-estree": "8.51.0",
|
|
193645
|
+
"@typescript-eslint/visitor-keys": "8.51.0",
|
|
193622
193646
|
debug: "^4.3.4"
|
|
193623
193647
|
},
|
|
193624
193648
|
devDependencies: {
|
|
@@ -197602,7 +197626,7 @@ var require_RuleCreator = __commonJS((exports) => {
|
|
|
197602
197626
|
var applyDefault_1 = require_applyDefault();
|
|
197603
197627
|
function RuleCreator(urlCreator) {
|
|
197604
197628
|
return function createNamedRule({ meta, name, ...rule }) {
|
|
197605
|
-
|
|
197629
|
+
const ruleWithDocs = createRule({
|
|
197606
197630
|
meta: {
|
|
197607
197631
|
...meta,
|
|
197608
197632
|
docs: {
|
|
@@ -197610,18 +197634,21 @@ var require_RuleCreator = __commonJS((exports) => {
|
|
|
197610
197634
|
url: urlCreator(name)
|
|
197611
197635
|
}
|
|
197612
197636
|
},
|
|
197637
|
+
name,
|
|
197613
197638
|
...rule
|
|
197614
197639
|
});
|
|
197640
|
+
return ruleWithDocs;
|
|
197615
197641
|
};
|
|
197616
197642
|
}
|
|
197617
|
-
function createRule({ create, defaultOptions, meta }) {
|
|
197643
|
+
function createRule({ create, defaultOptions, meta, name }) {
|
|
197618
197644
|
return {
|
|
197619
197645
|
create(context) {
|
|
197620
197646
|
const optionsWithDefault = (0, applyDefault_1.applyDefault)(defaultOptions, context.options);
|
|
197621
197647
|
return create(context, optionsWithDefault);
|
|
197622
197648
|
},
|
|
197623
197649
|
defaultOptions,
|
|
197624
|
-
meta
|
|
197650
|
+
meta,
|
|
197651
|
+
name
|
|
197625
197652
|
};
|
|
197626
197653
|
}
|
|
197627
197654
|
RuleCreator.withoutDocs = function withoutDocs(args) {
|
|
@@ -289876,7 +289903,7 @@ var require_predicates3 = __commonJS((exports) => {
|
|
|
289876
289903
|
}
|
|
289877
289904
|
for (const baseType of typeAndBaseTypes) {
|
|
289878
289905
|
const baseSymbol = baseType.getSymbol();
|
|
289879
|
-
if (baseSymbol
|
|
289906
|
+
if (baseSymbol?.name === parentSymbol.name) {
|
|
289880
289907
|
return true;
|
|
289881
289908
|
}
|
|
289882
289909
|
}
|
|
@@ -290287,7 +290314,7 @@ var require_misc2 = __commonJS((exports) => {
|
|
|
290287
290314
|
return groups;
|
|
290288
290315
|
}
|
|
290289
290316
|
function arraysAreEqual(a, b, eq) {
|
|
290290
|
-
return a === b || a != null &&
|
|
290317
|
+
return a === b || a != null && a.length === b?.length && a.every((x, idx) => eq(x, b[idx]));
|
|
290291
290318
|
}
|
|
290292
290319
|
function findFirstResult(inputs, getResult) {
|
|
290293
290320
|
for (const element of inputs) {
|
|
@@ -292250,7 +292277,7 @@ var require_consistent_generic_constructors = __commonJS((exports) => {
|
|
|
292250
292277
|
}
|
|
292251
292278
|
const [lhsName, rhs] = getLHSRHS();
|
|
292252
292279
|
const lhs = lhsName.typeAnnotation?.typeAnnotation;
|
|
292253
|
-
if (
|
|
292280
|
+
if (rhs?.type !== utils_1.AST_NODE_TYPES.NewExpression || rhs.callee.type !== utils_1.AST_NODE_TYPES.Identifier) {
|
|
292254
292281
|
return;
|
|
292255
292282
|
}
|
|
292256
292283
|
if (lhs && (lhs.type !== utils_1.AST_NODE_TYPES.TSTypeReference || lhs.typeName.type !== utils_1.AST_NODE_TYPES.Identifier || lhs.typeName.name !== rhs.callee.name || isBuiltInArray(lhs.typeName))) {
|
|
@@ -293978,7 +294005,7 @@ var require_explicitReturnTypeUtils = __commonJS((exports) => {
|
|
|
293978
294005
|
return node.type === utils_1.AST_NODE_TYPES.NewExpression;
|
|
293979
294006
|
}
|
|
293980
294007
|
function isPropertyOfObjectWithType(property) {
|
|
293981
|
-
if (
|
|
294008
|
+
if (property?.type !== utils_1.AST_NODE_TYPES.Property) {
|
|
293982
294009
|
return false;
|
|
293983
294010
|
}
|
|
293984
294011
|
const objectExpr = property.parent;
|
|
@@ -298367,7 +298394,7 @@ var require_no_dupe_class_members2 = __commonJS((exports) => {
|
|
|
298367
298394
|
if (node.computed) {
|
|
298368
298395
|
return;
|
|
298369
298396
|
}
|
|
298370
|
-
if (node.value
|
|
298397
|
+
if (node.value?.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
|
|
298371
298398
|
return;
|
|
298372
298399
|
}
|
|
298373
298400
|
return coreListener(node);
|
|
@@ -298694,7 +298721,6 @@ var require_no_dynamic_delete = __commonJS((exports) => {
|
|
|
298694
298721
|
description: "Disallow using the `delete` operator on computed key expressions",
|
|
298695
298722
|
recommended: "strict"
|
|
298696
298723
|
},
|
|
298697
|
-
fixable: "code",
|
|
298698
298724
|
messages: {
|
|
298699
298725
|
dynamicDelete: "Do not delete dynamically computed property keys."
|
|
298700
298726
|
},
|
|
@@ -298702,12 +298728,6 @@ var require_no_dynamic_delete = __commonJS((exports) => {
|
|
|
298702
298728
|
},
|
|
298703
298729
|
defaultOptions: [],
|
|
298704
298730
|
create(context) {
|
|
298705
|
-
function createFixer(member) {
|
|
298706
|
-
if (member.property.type === utils_1.AST_NODE_TYPES.Literal && typeof member.property.value === "string") {
|
|
298707
|
-
return createPropertyReplacement(member.property, `.${member.property.value}`);
|
|
298708
|
-
}
|
|
298709
|
-
return;
|
|
298710
|
-
}
|
|
298711
298731
|
return {
|
|
298712
298732
|
"UnaryExpression[operator=delete]"(node) {
|
|
298713
298733
|
if (node.argument.type !== utils_1.AST_NODE_TYPES.MemberExpression || !node.argument.computed || isAcceptableIndexExpression(node.argument.property)) {
|
|
@@ -298715,20 +298735,10 @@ var require_no_dynamic_delete = __commonJS((exports) => {
|
|
|
298715
298735
|
}
|
|
298716
298736
|
context.report({
|
|
298717
298737
|
node: node.argument.property,
|
|
298718
|
-
messageId: "dynamicDelete"
|
|
298719
|
-
fix: createFixer(node.argument)
|
|
298738
|
+
messageId: "dynamicDelete"
|
|
298720
298739
|
});
|
|
298721
298740
|
}
|
|
298722
298741
|
};
|
|
298723
|
-
function createPropertyReplacement(property, replacement) {
|
|
298724
|
-
return (fixer) => fixer.replaceTextRange(getTokenRange(property), replacement);
|
|
298725
|
-
}
|
|
298726
|
-
function getTokenRange(property) {
|
|
298727
|
-
return [
|
|
298728
|
-
(0, util_1.nullThrows)(context.sourceCode.getTokenBefore(property), util_1.NullThrowsReasons.MissingToken("token before", "property")).range[0],
|
|
298729
|
-
(0, util_1.nullThrows)(context.sourceCode.getTokenAfter(property), util_1.NullThrowsReasons.MissingToken("token after", "property")).range[1]
|
|
298730
|
-
];
|
|
298731
|
-
}
|
|
298732
298742
|
}
|
|
298733
298743
|
});
|
|
298734
298744
|
function isAcceptableIndexExpression(property) {
|
|
@@ -301411,7 +301421,7 @@ var require_no_misused_promises = __commonJS((exports) => {
|
|
|
301411
301421
|
});
|
|
301412
301422
|
}
|
|
301413
301423
|
function checkJSXAttribute(node) {
|
|
301414
|
-
if (node.value
|
|
301424
|
+
if (node.value?.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer) {
|
|
301415
301425
|
return;
|
|
301416
301426
|
}
|
|
301417
301427
|
const expressionContainer = services.esTreeNodeToTSNodeMap.get(node.value);
|
|
@@ -302430,7 +302440,7 @@ var require_no_redeclare2 = __commonJS((exports) => {
|
|
|
302430
302440
|
Program(node) {
|
|
302431
302441
|
const scope = context.sourceCode.getScope(node);
|
|
302432
302442
|
findVariablesInScope(scope);
|
|
302433
|
-
if (scope.type === scope_manager_1.ScopeType.global && scope.
|
|
302443
|
+
if (scope.type === scope_manager_1.ScopeType.global && scope.block === scope.childScopes[0]?.block) {
|
|
302434
302444
|
findVariablesInScope(scope.childScopes[0]);
|
|
302435
302445
|
}
|
|
302436
302446
|
},
|
|
@@ -304271,7 +304281,7 @@ var require_no_type_alias = __commonJS((exports) => {
|
|
|
304271
304281
|
if (type.node.type === utils_1.AST_NODE_TYPES.TSTupleType) {
|
|
304272
304282
|
return true;
|
|
304273
304283
|
}
|
|
304274
|
-
if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && ["keyof", "readonly"].includes(type.node.operator) && type.node.typeAnnotation
|
|
304284
|
+
if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && ["keyof", "readonly"].includes(type.node.operator) && type.node.typeAnnotation?.type === utils_1.AST_NODE_TYPES.TSTupleType) {
|
|
304275
304285
|
return true;
|
|
304276
304286
|
}
|
|
304277
304287
|
return false;
|
|
@@ -309004,7 +309014,7 @@ var require_classScopeAnalyzer = __commonJS((exports) => {
|
|
|
309004
309014
|
switch (firstDef.node.type) {
|
|
309005
309015
|
case utils_1.AST_NODE_TYPES.VariableDeclarator: {
|
|
309006
309016
|
const value = firstDef.node.init;
|
|
309007
|
-
if (value
|
|
309017
|
+
if (value?.type !== utils_1.AST_NODE_TYPES.ThisExpression) {
|
|
309008
309018
|
return null;
|
|
309009
309019
|
}
|
|
309010
309020
|
if (variable.references.some((ref) => ref.isWrite() && ref.init !== true)) {
|
|
@@ -310100,6 +310110,7 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310100
310110
|
},
|
|
310101
310111
|
fixable: "code",
|
|
310102
310112
|
messages: {
|
|
310113
|
+
preferOptionalSyntax: "Using `= undefined` to make a parameter optional adds unnecessary runtime logic. Use the `?` optional syntax instead.",
|
|
310103
310114
|
uselessDefaultAssignment: "Default value is useless because the {{ type }} is not optional.",
|
|
310104
310115
|
uselessUndefined: "Default value is useless because it is undefined. Optional {{ type }}s are already undefined by default."
|
|
310105
310116
|
},
|
|
@@ -310109,8 +310120,6 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310109
310120
|
create(context) {
|
|
310110
310121
|
const services = (0, util_1.getParserServices)(context);
|
|
310111
310122
|
const checker = services.program.getTypeChecker();
|
|
310112
|
-
const compilerOptions = services.program.getCompilerOptions();
|
|
310113
|
-
const isNoUncheckedIndexedAccess = tsutils.isCompilerOptionEnabled(compilerOptions, "noUncheckedIndexedAccess");
|
|
310114
310123
|
function canBeUndefined(type) {
|
|
310115
310124
|
if ((0, util_1.isTypeAnyType)(type) || (0, util_1.isTypeUnknownType)(type)) {
|
|
310116
310125
|
return true;
|
|
@@ -310120,10 +310129,7 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310120
310129
|
function getPropertyType(objectType, propertyName) {
|
|
310121
310130
|
const symbol = objectType.getProperty(propertyName);
|
|
310122
310131
|
if (!symbol) {
|
|
310123
|
-
|
|
310124
|
-
return null;
|
|
310125
|
-
}
|
|
310126
|
-
return objectType.getStringIndexType() ?? null;
|
|
310132
|
+
return null;
|
|
310127
310133
|
}
|
|
310128
310134
|
return checker.getTypeOfSymbol(symbol);
|
|
310129
310135
|
}
|
|
@@ -310134,15 +310140,17 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310134
310140
|
return tupleArgs[elementIndex];
|
|
310135
310141
|
}
|
|
310136
310142
|
}
|
|
310137
|
-
if (isNoUncheckedIndexedAccess) {
|
|
310138
|
-
return null;
|
|
310139
|
-
}
|
|
310140
310143
|
return arrayType.getNumberIndexType() ?? null;
|
|
310141
310144
|
}
|
|
310142
310145
|
function checkAssignmentPattern(node) {
|
|
310143
310146
|
if (node.right.type === utils_1.AST_NODE_TYPES.Identifier && node.right.name === "undefined") {
|
|
310147
|
+
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
|
|
310148
|
+
if (ts.isParameter(tsNode) && tsNode.type && canBeUndefined(checker.getTypeFromTypeNode(tsNode.type))) {
|
|
310149
|
+
reportPreferOptionalSyntax(node);
|
|
310150
|
+
return;
|
|
310151
|
+
}
|
|
310144
310152
|
const type = node.parent.type === utils_1.AST_NODE_TYPES.Property || node.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern ? "property" : "parameter";
|
|
310145
|
-
|
|
310153
|
+
reportUselessUndefined(node, type);
|
|
310146
310154
|
return;
|
|
310147
310155
|
}
|
|
310148
310156
|
const parent = node.parent;
|
|
@@ -310156,13 +310164,16 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310156
310164
|
return;
|
|
310157
310165
|
}
|
|
310158
310166
|
const signatures = contextualType.getCallSignatures();
|
|
310167
|
+
if (signatures.length === 0 || signatures[0].getDeclaration() === tsFunc) {
|
|
310168
|
+
return;
|
|
310169
|
+
}
|
|
310159
310170
|
const params = signatures[0].getParameters();
|
|
310160
310171
|
if (paramIndex < params.length) {
|
|
310161
310172
|
const paramSymbol = params[paramIndex];
|
|
310162
310173
|
if ((paramSymbol.flags & ts.SymbolFlags.Optional) === 0) {
|
|
310163
310174
|
const paramType = checker.getTypeOfSymbol(paramSymbol);
|
|
310164
310175
|
if (!canBeUndefined(paramType)) {
|
|
310165
|
-
|
|
310176
|
+
reportUselessDefaultAssignment(node, "parameter");
|
|
310166
310177
|
}
|
|
310167
310178
|
}
|
|
310168
310179
|
}
|
|
@@ -310176,20 +310187,24 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310176
310187
|
return;
|
|
310177
310188
|
}
|
|
310178
310189
|
if (!canBeUndefined(propertyType)) {
|
|
310179
|
-
|
|
310190
|
+
reportUselessDefaultAssignment(node, "property");
|
|
310180
310191
|
}
|
|
310181
310192
|
} else if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) {
|
|
310182
310193
|
const sourceType = getSourceTypeForPattern(parent);
|
|
310183
310194
|
if (!sourceType) {
|
|
310184
310195
|
return;
|
|
310185
310196
|
}
|
|
310197
|
+
if (!checker.isTupleType(sourceType)) {
|
|
310198
|
+
return;
|
|
310199
|
+
}
|
|
310200
|
+
const tupleArgs = checker.getTypeArguments(sourceType);
|
|
310186
310201
|
const elementIndex = parent.elements.indexOf(node);
|
|
310187
|
-
|
|
310188
|
-
if (!elementType) {
|
|
310202
|
+
if (elementIndex < 0 || elementIndex >= tupleArgs.length) {
|
|
310189
310203
|
return;
|
|
310190
310204
|
}
|
|
310205
|
+
const elementType = tupleArgs[elementIndex];
|
|
310191
310206
|
if (!canBeUndefined(elementType)) {
|
|
310192
|
-
|
|
310207
|
+
reportUselessDefaultAssignment(node, "property");
|
|
310193
310208
|
}
|
|
310194
310209
|
}
|
|
310195
310210
|
}
|
|
@@ -310245,18 +310260,40 @@ var require_no_useless_default_assignment = __commonJS((exports) => {
|
|
|
310245
310260
|
return null;
|
|
310246
310261
|
}
|
|
310247
310262
|
}
|
|
310248
|
-
function
|
|
310263
|
+
function reportUselessDefaultAssignment(node, type) {
|
|
310249
310264
|
context.report({
|
|
310250
310265
|
node: node.right,
|
|
310251
|
-
messageId,
|
|
310266
|
+
messageId: "uselessDefaultAssignment",
|
|
310252
310267
|
data: { type },
|
|
310253
|
-
fix(fixer)
|
|
310254
|
-
|
|
310255
|
-
|
|
310256
|
-
|
|
310268
|
+
fix: (fixer) => removeDefault(fixer, node)
|
|
310269
|
+
});
|
|
310270
|
+
}
|
|
310271
|
+
function reportUselessUndefined(node, type) {
|
|
310272
|
+
context.report({
|
|
310273
|
+
node: node.right,
|
|
310274
|
+
messageId: "uselessUndefined",
|
|
310275
|
+
data: { type },
|
|
310276
|
+
fix: (fixer) => removeDefault(fixer, node)
|
|
310277
|
+
});
|
|
310278
|
+
}
|
|
310279
|
+
function reportPreferOptionalSyntax(node) {
|
|
310280
|
+
context.report({
|
|
310281
|
+
node: node.right,
|
|
310282
|
+
messageId: "preferOptionalSyntax",
|
|
310283
|
+
*fix(fixer) {
|
|
310284
|
+
yield removeDefault(fixer, node);
|
|
310285
|
+
const { left } = node;
|
|
310286
|
+
if (left.type === utils_1.AST_NODE_TYPES.Identifier) {
|
|
310287
|
+
yield fixer.insertTextAfterRange([left.range[0], left.range[0] + left.name.length], "?");
|
|
310288
|
+
}
|
|
310257
310289
|
}
|
|
310258
310290
|
});
|
|
310259
310291
|
}
|
|
310292
|
+
function removeDefault(fixer, node) {
|
|
310293
|
+
const start = node.left.range[1];
|
|
310294
|
+
const end = node.range[1];
|
|
310295
|
+
return fixer.removeRange([start, end]);
|
|
310296
|
+
}
|
|
310260
310297
|
return {
|
|
310261
310298
|
AssignmentPattern: checkAssignmentPattern
|
|
310262
310299
|
};
|
|
@@ -312086,7 +312123,7 @@ var require_prefer_namespace_keyword = __commonJS((exports) => {
|
|
|
312086
312123
|
return;
|
|
312087
312124
|
}
|
|
312088
312125
|
const moduleType = context.sourceCode.getTokenBefore(node.id);
|
|
312089
|
-
if (moduleType
|
|
312126
|
+
if (moduleType?.type === utils_1.AST_TOKEN_TYPES.Identifier && moduleType.value === "module") {
|
|
312090
312127
|
context.report({
|
|
312091
312128
|
node,
|
|
312092
312129
|
messageId: "useNamespace",
|
|
@@ -312438,7 +312475,7 @@ var require_prefer_nullish_coalescing = __commonJS((exports) => {
|
|
|
312438
312475
|
} else if (node.consequent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) {
|
|
312439
312476
|
assignmentExpression = node.consequent.expression;
|
|
312440
312477
|
}
|
|
312441
|
-
if (
|
|
312478
|
+
if (assignmentExpression?.type !== utils_1.AST_NODE_TYPES.AssignmentExpression || !isMemberAccessLike(assignmentExpression.left)) {
|
|
312442
312479
|
return;
|
|
312443
312480
|
}
|
|
312444
312481
|
const nullishCoalescingLeftNode = assignmentExpression.left;
|
|
@@ -312958,12 +312995,18 @@ var require_gatherLogicalOperands = __commonJS((exports) => {
|
|
|
312958
312995
|
};
|
|
312959
312996
|
}();
|
|
312960
312997
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
312961
|
-
exports.ComparisonType = exports.NullishComparisonType = exports.OperandValidity = undefined;
|
|
312998
|
+
exports.ComparisonType = exports.NullishComparisonType = exports.OperandValidity = exports.Yoda = undefined;
|
|
312962
312999
|
exports.gatherLogicalOperands = gatherLogicalOperands;
|
|
312963
313000
|
var utils_1 = require_dist10();
|
|
312964
313001
|
var ts_api_utils_1 = require_lib4();
|
|
312965
313002
|
var ts = __importStar(require_typescript());
|
|
312966
313003
|
var util_1 = require_util3();
|
|
313004
|
+
var Yoda;
|
|
313005
|
+
(function(Yoda2) {
|
|
313006
|
+
Yoda2[Yoda2["Yes"] = 0] = "Yes";
|
|
313007
|
+
Yoda2[Yoda2["No"] = 1] = "No";
|
|
313008
|
+
Yoda2[Yoda2["Unknown"] = 2] = "Unknown";
|
|
313009
|
+
})(Yoda || (exports.Yoda = Yoda = {}));
|
|
312967
313010
|
var ComparisonValueType;
|
|
312968
313011
|
(function(ComparisonValueType2) {
|
|
312969
313012
|
ComparisonValueType2["Null"] = "Null";
|
|
@@ -313106,7 +313149,7 @@ var require_gatherLogicalOperands = __commonJS((exports) => {
|
|
|
313106
313149
|
}
|
|
313107
313150
|
const binaryComparisonChain = getBinaryComparisonChain(operand);
|
|
313108
313151
|
if (binaryComparisonChain) {
|
|
313109
|
-
const { comparedName, comparedValue: comparedValue2,
|
|
313152
|
+
const { comparedName, comparedValue: comparedValue2, yoda } = binaryComparisonChain;
|
|
313110
313153
|
switch (operand.operator) {
|
|
313111
313154
|
case "==":
|
|
313112
313155
|
case "===": {
|
|
@@ -313115,9 +313158,9 @@ var require_gatherLogicalOperands = __commonJS((exports) => {
|
|
|
313115
313158
|
comparedName,
|
|
313116
313159
|
comparisonType,
|
|
313117
313160
|
comparisonValue: comparedValue2,
|
|
313118
|
-
isYoda: isYoda2,
|
|
313119
313161
|
node: operand,
|
|
313120
|
-
type: OperandValidity.Last
|
|
313162
|
+
type: OperandValidity.Last,
|
|
313163
|
+
yoda
|
|
313121
313164
|
});
|
|
313122
313165
|
continue;
|
|
313123
313166
|
}
|
|
@@ -313128,9 +313171,9 @@ var require_gatherLogicalOperands = __commonJS((exports) => {
|
|
|
313128
313171
|
comparedName,
|
|
313129
313172
|
comparisonType,
|
|
313130
313173
|
comparisonValue: comparedValue2,
|
|
313131
|
-
isYoda: isYoda2,
|
|
313132
313174
|
node: operand,
|
|
313133
|
-
type: OperandValidity.Last
|
|
313175
|
+
type: OperandValidity.Last,
|
|
313176
|
+
yoda
|
|
313134
313177
|
});
|
|
313135
313178
|
continue;
|
|
313136
313179
|
}
|
|
@@ -313211,26 +313254,40 @@ var require_gatherLogicalOperands = __commonJS((exports) => {
|
|
|
313211
313254
|
}
|
|
313212
313255
|
return null;
|
|
313213
313256
|
}
|
|
313257
|
+
function isMemberBasedExpression(node2) {
|
|
313258
|
+
if (node2.type === utils_1.AST_NODE_TYPES.MemberExpression) {
|
|
313259
|
+
return true;
|
|
313260
|
+
}
|
|
313261
|
+
if (node2.type === utils_1.AST_NODE_TYPES.CallExpression && node2.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
|
|
313262
|
+
return true;
|
|
313263
|
+
}
|
|
313264
|
+
return false;
|
|
313265
|
+
}
|
|
313214
313266
|
function getBinaryComparisonChain(node2) {
|
|
313215
313267
|
const { left, right } = node2;
|
|
313216
|
-
|
|
313217
|
-
const
|
|
313218
|
-
const isRightMemberExpression = right.type === utils_1.AST_NODE_TYPES.MemberExpression;
|
|
313268
|
+
const isLeftMemberExpression = isMemberBasedExpression(left);
|
|
313269
|
+
const isRightMemberExpression = isMemberBasedExpression(right);
|
|
313219
313270
|
if (isLeftMemberExpression && !isRightMemberExpression) {
|
|
313220
313271
|
const [comparedName, comparedValue] = [left, right];
|
|
313221
313272
|
return {
|
|
313222
313273
|
comparedName,
|
|
313223
313274
|
comparedValue,
|
|
313224
|
-
|
|
313275
|
+
yoda: Yoda.No
|
|
313225
313276
|
};
|
|
313226
313277
|
}
|
|
313227
313278
|
if (!isLeftMemberExpression && isRightMemberExpression) {
|
|
313228
313279
|
const [comparedName, comparedValue] = [right, left];
|
|
313229
|
-
isYoda = true;
|
|
313230
313280
|
return {
|
|
313231
313281
|
comparedName,
|
|
313232
313282
|
comparedValue,
|
|
313233
|
-
|
|
313283
|
+
yoda: Yoda.Yes
|
|
313284
|
+
};
|
|
313285
|
+
}
|
|
313286
|
+
if (isLeftMemberExpression && isRightMemberExpression) {
|
|
313287
|
+
return {
|
|
313288
|
+
comparedName: left,
|
|
313289
|
+
comparedValue: right,
|
|
313290
|
+
yoda: Yoda.Unknown
|
|
313234
313291
|
};
|
|
313235
313292
|
}
|
|
313236
313293
|
return null;
|
|
@@ -313401,6 +313458,40 @@ var require_analyzeChain = __commonJS((exports) => {
|
|
|
313401
313458
|
return null;
|
|
313402
313459
|
}
|
|
313403
313460
|
};
|
|
313461
|
+
var resolveOperandSubset = (previousOperand, lastChainOperand) => {
|
|
313462
|
+
const isNameSubset = (0, compareNodes_1.compareNodes)(previousOperand.comparedName, lastChainOperand.comparedName) === compareNodes_1.NodeComparisonResult.Subset;
|
|
313463
|
+
if (lastChainOperand.yoda !== gatherLogicalOperands_1.Yoda.Unknown) {
|
|
313464
|
+
return {
|
|
313465
|
+
comparedName: lastChainOperand.comparedName,
|
|
313466
|
+
comparisonValue: lastChainOperand.comparisonValue,
|
|
313467
|
+
isSubset: isNameSubset,
|
|
313468
|
+
isYoda: lastChainOperand.yoda === gatherLogicalOperands_1.Yoda.Yes
|
|
313469
|
+
};
|
|
313470
|
+
}
|
|
313471
|
+
const isValueSubset = (0, compareNodes_1.compareNodes)(previousOperand.comparedName, lastChainOperand.comparisonValue) === compareNodes_1.NodeComparisonResult.Subset;
|
|
313472
|
+
if (isNameSubset && !isValueSubset) {
|
|
313473
|
+
return {
|
|
313474
|
+
comparedName: lastChainOperand.comparedName,
|
|
313475
|
+
comparisonValue: lastChainOperand.comparisonValue,
|
|
313476
|
+
isSubset: true,
|
|
313477
|
+
isYoda: false
|
|
313478
|
+
};
|
|
313479
|
+
}
|
|
313480
|
+
if (!isNameSubset && isValueSubset) {
|
|
313481
|
+
return {
|
|
313482
|
+
comparedName: lastChainOperand.comparisonValue,
|
|
313483
|
+
comparisonValue: lastChainOperand.comparedName,
|
|
313484
|
+
isSubset: true,
|
|
313485
|
+
isYoda: true
|
|
313486
|
+
};
|
|
313487
|
+
}
|
|
313488
|
+
return {
|
|
313489
|
+
comparedName: lastChainOperand.comparisonValue,
|
|
313490
|
+
comparisonValue: lastChainOperand.comparisonValue,
|
|
313491
|
+
isSubset: false,
|
|
313492
|
+
isYoda: true
|
|
313493
|
+
};
|
|
313494
|
+
};
|
|
313404
313495
|
function getReportRange(chain, boundary, sourceCode) {
|
|
313405
313496
|
const leftNode = chain[0].node;
|
|
313406
313497
|
const rightNode = chain[chain.length - 1].node;
|
|
@@ -313618,10 +313709,15 @@ var require_analyzeChain = __commonJS((exports) => {
|
|
|
313618
313709
|
}
|
|
313619
313710
|
const lastOperand = subChain.flat().at(-1);
|
|
313620
313711
|
if (lastOperand && lastChainOperand) {
|
|
313621
|
-
const comparisonResult = (0, compareNodes_1.compareNodes)(lastOperand.comparedName, lastChainOperand.comparedName);
|
|
313622
313712
|
const isValidLastChainOperand = operator === "&&" ? isValidAndLastChainOperand : isValidOrLastChainOperand;
|
|
313623
|
-
|
|
313624
|
-
|
|
313713
|
+
const { comparedName, comparisonValue, isSubset, isYoda } = resolveOperandSubset(lastOperand, lastChainOperand);
|
|
313714
|
+
if (isSubset && isValidLastChainOperand(comparisonValue, lastChainOperand.comparisonType, parserServices)) {
|
|
313715
|
+
lastChain = {
|
|
313716
|
+
...lastChainOperand,
|
|
313717
|
+
comparedName,
|
|
313718
|
+
comparisonValue,
|
|
313719
|
+
isYoda
|
|
313720
|
+
};
|
|
313625
313721
|
}
|
|
313626
313722
|
}
|
|
313627
313723
|
maybeReportThenReset();
|
|
@@ -318429,7 +318525,7 @@ var require_unified_signatures = __commonJS((exports) => {
|
|
|
318429
318525
|
return parametersHaveEqualSigils(a, b) && a.type !== utils_1.AST_NODE_TYPES.RestElement ? { kind: "single-parameter-difference", p0: a, p1: b } : undefined;
|
|
318430
318526
|
}
|
|
318431
318527
|
function isThisParam(param) {
|
|
318432
|
-
return param
|
|
318528
|
+
return param?.type === utils_1.AST_NODE_TYPES.Identifier && param.name === "this";
|
|
318433
318529
|
}
|
|
318434
318530
|
function isThisVoidParam(param) {
|
|
318435
318531
|
return isThisParam(param) && param.typeAnnotation?.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSVoidKeyword;
|
|
@@ -318521,7 +318617,7 @@ var require_unified_signatures = __commonJS((exports) => {
|
|
|
318521
318617
|
return a === b || a != null && b != null && context.sourceCode.getText(a.typeAnnotation) === context.sourceCode.getText(b.typeAnnotation);
|
|
318522
318618
|
}
|
|
318523
318619
|
function constraintsAreEqual(a, b) {
|
|
318524
|
-
return a === b || a != null &&
|
|
318620
|
+
return a === b || a != null && a.type === b?.type;
|
|
318525
318621
|
}
|
|
318526
318622
|
function getIndexOfFirstDifference(a, b, equal) {
|
|
318527
318623
|
for (let i = 0;i < a.length && i < b.length; i++) {
|
|
@@ -318563,7 +318659,7 @@ var require_unified_signatures = __commonJS((exports) => {
|
|
|
318563
318659
|
}
|
|
318564
318660
|
function addOverload(signature, key, containingNode) {
|
|
318565
318661
|
key ??= getOverloadKey(signature);
|
|
318566
|
-
if (
|
|
318662
|
+
if ((containingNode ?? signature).parent === currentScope?.parent) {
|
|
318567
318663
|
const overloads = currentScope.overloads.get(key);
|
|
318568
318664
|
if (overloads != null) {
|
|
318569
318665
|
overloads.push(signature);
|
|
@@ -319195,7 +319291,7 @@ var require_rules4 = __commonJS((exports, module) => {
|
|
|
319195
319291
|
var require_package7 = __commonJS((exports, module) => {
|
|
319196
319292
|
module.exports = {
|
|
319197
319293
|
name: "@typescript-eslint/eslint-plugin",
|
|
319198
|
-
version: "8.
|
|
319294
|
+
version: "8.51.0",
|
|
319199
319295
|
description: "TypeScript plugin for ESLint",
|
|
319200
319296
|
files: [
|
|
319201
319297
|
"dist",
|
|
@@ -319254,22 +319350,21 @@ var require_package7 = __commonJS((exports, module) => {
|
|
|
319254
319350
|
},
|
|
319255
319351
|
dependencies: {
|
|
319256
319352
|
"@eslint-community/regexpp": "^4.10.0",
|
|
319257
|
-
"@typescript-eslint/scope-manager": "8.
|
|
319258
|
-
"@typescript-eslint/type-utils": "8.
|
|
319259
|
-
"@typescript-eslint/utils": "8.
|
|
319260
|
-
"@typescript-eslint/visitor-keys": "8.
|
|
319353
|
+
"@typescript-eslint/scope-manager": "8.51.0",
|
|
319354
|
+
"@typescript-eslint/type-utils": "8.51.0",
|
|
319355
|
+
"@typescript-eslint/utils": "8.51.0",
|
|
319356
|
+
"@typescript-eslint/visitor-keys": "8.51.0",
|
|
319261
319357
|
ignore: "^7.0.0",
|
|
319262
319358
|
"natural-compare": "^1.4.0",
|
|
319263
|
-
"ts-api-utils": "^2.
|
|
319359
|
+
"ts-api-utils": "^2.2.0"
|
|
319264
319360
|
},
|
|
319265
319361
|
devDependencies: {
|
|
319266
319362
|
"@types/mdast": "^4.0.3",
|
|
319267
319363
|
"@types/natural-compare": "*",
|
|
319268
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.
|
|
319269
|
-
"@typescript-eslint/rule-tester": "8.
|
|
319364
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.51.0",
|
|
319365
|
+
"@typescript-eslint/rule-tester": "8.51.0",
|
|
319270
319366
|
"@vitest/coverage-v8": "^3.1.3",
|
|
319271
319367
|
ajv: "^6.12.6",
|
|
319272
|
-
"cross-fetch": "*",
|
|
319273
319368
|
eslint: "*",
|
|
319274
319369
|
"json-schema": "*",
|
|
319275
319370
|
"markdown-table": "^3.0.3",
|
|
@@ -319286,7 +319381,7 @@ var require_package7 = __commonJS((exports, module) => {
|
|
|
319286
319381
|
vitest: "^3.1.3"
|
|
319287
319382
|
},
|
|
319288
319383
|
peerDependencies: {
|
|
319289
|
-
"@typescript-eslint/parser": "^8.
|
|
319384
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
319290
319385
|
eslint: "^8.57.0 || ^9.0.0",
|
|
319291
319386
|
typescript: ">=4.8.4 <6.0.0"
|
|
319292
319387
|
},
|
|
@@ -319418,6 +319513,7 @@ var require_raw_plugin = __commonJS((exports, module) => {
|
|
|
319418
319513
|
},
|
|
319419
319514
|
meta: {
|
|
319420
319515
|
name,
|
|
319516
|
+
namespace: "@typescript-eslint",
|
|
319421
319517
|
version
|
|
319422
319518
|
},
|
|
319423
319519
|
rules: rules_1.default
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/config",
|
|
3
3
|
"description": "Shared configuration for ElizaOS projects and plugins",
|
|
4
|
-
"version": "1.7.1-alpha.
|
|
4
|
+
"version": "1.7.1-alpha.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "108b83e9ec584b0c0093b76b3d137a2086579aae"
|
|
55
55
|
}
|