Files
NapCatQQ/.pnpm-store/v3/files/ce/620d11f68294756d6a49cb1c099e71ccbdc61391360dd10787bc23e76b35b33555a303f1638575c57c95701d604fe3a20027a6d702901e24fcf6f8b4741599
T
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

64 lines
1.8 KiB
Plaintext

"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Date.prototype.toGMTString` method.",
category: "legacy",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-date-prototype-togmtstring.html",
},
fixable: "code",
messages: {
forbidden: "Annex B feature '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
hasSuggestions: true,
},
create(context) {
return definePrototypeMethodHandler(
context,
{
Date: ["toGMTString"],
},
{
createReport({ objectTypeResult, node }) {
if (node.computed) {
return null
}
if (objectTypeResult !== true) {
return {
suggest: [
{
desc: "Replace with 'toUTCString'",
fix,
},
],
}
}
return {
fix,
}
function fix(fixer) {
return fixer.replaceText(node.property, "toUTCString")
}
},
},
)
},
}