Files
NapCatQQ/.pnpm-store/v3/files/ec/4200f8d91b5767430a185369fa1b8dbcd35cb9b54e49c73b0de7b28daeaab2cf0a97a935691edea6b53d0ad1c33144a952648c0184579deb527c0ddde03097
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

51 lines
1.6 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-utils")
module.exports = {
meta: {
docs: {
description: "disallow ES2015 typed arrays.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-typed-arrays.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Int8Array: { [READ]: true },
Uint8Array: { [READ]: true },
Uint8ClampedArray: { [READ]: true },
Int16Array: { [READ]: true },
Uint16Array: { [READ]: true },
Int32Array: { [READ]: true },
Uint32Array: { [READ]: true },
Float32Array: { [READ]: true },
Float64Array: { [READ]: true },
DataView: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}