Files
NapCatQQ/.pnpm-store/v3/files/43/5cc974ce3e2d1d703d258585d554ba15ee520bae64f66c3d7b7d382acdcdb6a60d53ba9e15a1265b40880dab239f1deface4d90472136c95645316372b82c3
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.3 KiB
Plaintext

"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.toSorted` method.",
category: "ES2023",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-tosorted.html",
},
fixable: null,
messages: {
forbidden: "ES2023 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["toSorted"],
Int8Array: ["toSorted"],
Uint8Array: ["toSorted"],
Uint8ClampedArray: ["toSorted"],
Int16Array: ["toSorted"],
Uint16Array: ["toSorted"],
Int32Array: ["toSorted"],
Uint32Array: ["toSorted"],
Float32Array: ["toSorted"],
Float64Array: ["toSorted"],
BigInt64Array: ["toSorted"],
BigUint64Array: ["toSorted"],
})
},
}