Files
NapCatQQ/.pnpm-store/v3/files/4b/0f1229624e89a61a733dd6a13af81d87c2c9f6d889efef1b9b706ed34a739639468156b769d1e4f168f3e40aa3bf9a20e19bc349693cbfd0bf0358eb3a6c45
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

43 lines
1.3 KiB
Plaintext

"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Intl.PluralRules` object.",
category: "ES2018-Intl-API",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-intl-pluralrules.html",
},
fixable: null,
messages: {
forbidden: "ES2018 Intl API '{{name}}' object 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({
Intl: {
PluralRules: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}