[READ-ONLY] Mirror of https://github.com/bombshell-dev/tools. Internal CLI to standardize tooling across all Bombshell projects
0

Configure Feed

Select the types of activity you want to include in your feed.

feat(lint): add default lint rules

Nate Moore (Mar 3, 2026, 11:11 PM EST) 5f439690 582cd8eb

+57 -4
+5
.changeset/afraid-heads-appear.md
··· 1 + --- 2 + "@bomb.sh/tools": minor 3 + --- 4 + 5 + Add default lint rules with oxlint
+36
oxlintrc.json
··· 1 + { 2 + "$schema": "./node_modules/oxlint/configuration_schema.json", 3 + "plugins": ["unicorn", "typescript", "oxc", "import", "node"], 4 + "jsPlugins": ["./rules/plugin.js"], 5 + "categories": { 6 + "correctness": "error", 7 + "suspicious": "warn" 8 + }, 9 + "rules": { 10 + "no-restricted-imports": [ 11 + "error", 12 + { 13 + "paths": [ 14 + { 15 + "name": "node:path", 16 + "message": "Use File URLs (new URL()) instead. Only use fileURLToPath() at third-party module boundaries." 17 + }, 18 + { 19 + "name": "path", 20 + "message": "Use File URLs (new URL()) instead. Only use fileURLToPath() at third-party module boundaries." 21 + }, 22 + { 23 + "name": "node:path/posix", 24 + "message": "Use File URLs (new URL()) instead." 25 + }, 26 + { 27 + "name": "node:path/win32", 28 + "message": "Use File URLs (new URL()) instead." 29 + } 30 + ] 31 + } 32 + ], 33 + "import/no-commonjs": "error", 34 + "node/no-path-concat": "error" 35 + } 36 + }
+9
rules/plugin.js
··· 1 + /** @type {import("oxlint").Plugin} */ 2 + const plugin = { 3 + meta: { 4 + name: "bombshell-dev", 5 + }, 6 + rules: {}, 7 + }; 8 + 9 + export default plugin;
+3 -3
src/commands/init.ts
··· 1 1 import { readFile, writeFile } from "node:fs/promises"; 2 - import { dirname, sep } from "node:path"; 3 2 import { cwd } from "node:process"; 4 3 import { pathToFileURL } from "node:url"; 5 4 import { x } from "tinyexec"; ··· 7 6 8 7 export async function init(ctx: CommandContext) { 9 8 const [_name = "."] = ctx.args; 10 - const name = _name === "." ? dirname(cwd()) : _name; 11 - const dest = new URL("./.temp/", pathToFileURL([cwd(), sep].join(""))); 9 + const cwdUrl = pathToFileURL(`${cwd()}/`); 10 + const name = _name === "." ? new URL("../", cwdUrl).pathname.split("/").filter(Boolean).pop()! : _name; 11 + const dest = new URL("./.temp/", cwdUrl); 12 12 for await (const line of x("pnpx", ["giget@latest", "gh:bombshell-dev/template", name])) { 13 13 console.log(line); 14 14 }
+4 -1
src/commands/lint.ts
··· 1 + import { fileURLToPath } from "node:url"; 1 2 import { x } from "tinyexec"; 2 3 import type { CommandContext } from "../context.ts"; 3 4 import { local } from "../utils.ts"; 5 + 6 + const config = fileURLToPath(new URL("../../oxlintrc.json", import.meta.url)); 4 7 5 8 export async function lint(ctx: CommandContext) { 6 - const oxlint = x(local("oxlint"), ["./src", ...ctx.args]); 9 + const oxlint = x(local("oxlint"), ["-c", config, "./src", ...ctx.args]); 7 10 8 11 for await (const line of oxlint) { 9 12 console.log(line);