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

47 lines
1.4 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-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.isArray` method.",
category: "ES5",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-isarray.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Array: {
isArray: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}