Files
NapCatQQ/.pnpm-store/v3/files/05/2b64076ac80b030b838a2dd82e5ea4f5436335563648a7a0cd534b8d475946649c50a0029de77878b014a1488d621147a32a9a798f3a80c433d9f14381411c
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

47 lines
1.3 KiB
Plaintext

/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description:
"disallow `super` property accesses in object literals.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-object-super-properties.html",
},
fixable: null,
messages: {
forbidden:
"ES2015 'super' property accesses in object literals are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
let stack = null
return {
Super(node) {
if (stack && stack.inObjectMethod) {
context.report({ node, messageId: "forbidden" })
}
},
":matches(FunctionExpression, FunctionDeclaration)"(node) {
const { type, method } = node.parent
stack = {
inObjectMethod: type === "Property" && method === true,
upper: stack,
}
},
":matches(FunctionExpression, FunctionDeclaration):exit"() {
stack = stack.upper
},
}
},
}