Use regex to test node name

This commit is contained in:
Johannes Marbach
2026-06-24 10:49:18 +02:00
parent 1cd2764eb2
commit 9d61ca13cb

View File

@@ -41,7 +41,7 @@ const rule = ESLintUtils.RuleCreator(
node.parent.object === node &&
node.parent.property.type === "Identifier" &&
!safeScopeMethods.includes(node.parent.property.name) &&
node.name.endsWith("cope")
/(^s|S)cope$/.test(node.name)
) {
// TODO: Once oxlint supports lint rules that rely on TypeScript type-awareness,
// Verify that the variable is actually of type ObservableScope rather than just