This commit is contained in:
2026-03-15 12:22:42 +01:00
parent cd99275933
commit 311ba5e7f3
558 changed files with 55182 additions and 22981 deletions

View File

@@ -262,9 +262,10 @@ function getFunctionHeadLocation(node, sourceCode) {
start = arrowToken.loc.start;
end = arrowToken.loc.end;
} else if (
parent.type === "Property" ||
parent.type === "MethodDefinition" ||
parent.type === "PropertyDefinition"
parent &&
(parent.type === "Property" ||
parent.type === "MethodDefinition" ||
parent.type === "PropertyDefinition")
) {
start = /** @type {SourceLocation} */ (parent.loc).start;
end = getOpeningParenOfParams(node, sourceCode).loc.start;
@@ -1302,6 +1303,11 @@ function getPropertyName(node, initialScope) {
// eslint-disable-next-line complexity
function getFunctionNameWithKind(node, sourceCode) {
const parent = /** @type {RuleNode} */ (node).parent;
if (!parent) {
return ""
}
const tokens = [];
const isObjectMethod = parent.type === "Property" && parent.value === node;
const isClassMethod =
@@ -1655,6 +1661,10 @@ function hasSideEffect(node, sourceCode, options = {}) {
function getParentSyntaxParen(node, sourceCode) {
const parent = /** @type {RuleNode} */ (node).parent;
if (!parent) {
return null
}
switch (parent.type) {
case "CallExpression":
case "NewExpression":
@@ -2308,6 +2318,9 @@ class ReferenceTracker {
}
const parent = /** @type {RuleNode} */ (node).parent;
if (!parent) {
return
}
if (parent.type === "MemberExpression") {
if (parent.object === node) {
const key = getPropertyName(parent);