Files
NapCatQQ/.pnpm-store/v3/files/50/664673bc2ec4be296e48bcf7dfc920ffbb153c74055a2ae16c1915ff28a29e7e6d61e6ca7a5a69423086107eb65b1c3f4be3ce278a9326fca1ece0e99b4b87
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 `Number.MAX_SAFE_INTEGER` property.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-number-maxsafeinteger.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' property 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({
Number: {
MAX_SAFE_INTEGER: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}