Files
NapCatQQ/.pnpm-store/v3/files/78/675b3cc70c4cc9fc69ea9b2a148085fdb2abaef3315b77c0f8444ed2dc67cab24a479f3a50f2a7fda0e10557aa6e22dec19f17965527aa45d2e5259028ccae
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

45 lines
1.3 KiB
Plaintext

/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description:
"disallow the `Object.getOwnPropertyDescriptor` method.",
category: "ES5",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-object-getownpropertydescriptor.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Object: {
getOwnPropertyDescriptor: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}