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

44 lines
1.2 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.keys` method.",
category: "ES5",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-object-keys.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: {
keys: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}