@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 25 lines 596 Bytes
Raw
1 import type { CreateRule, Visitor } from "@oxlint/plugins"
2
3 const rule: CreateRule = {
4 meta: {
5 type: "problem",
6 docs: { description: "Disallow bigint literals" },
7 fixable: "code"
8 },
9 create(context) {
10 return {
11 Literal(node) {
12 if (typeof node.value === "bigint") {
13 const fixedSource = `BigInt("${node.value}")`
14 context.report({
15 node,
16 message: "BigInt literals are not allowed",
17 fix: (fixer) => fixer.replaceText(node, fixedSource)
18 })
19 }
20 }
21 } as Visitor
22 }
23 }
24
25 export default rule