Add ESLint to all packages and reorganize CLI
ESLint: - Add @macalinao/eslint-config and eslint to all packages/apps - Add lint scripts to all package.json files - Create eslint.config.js for all apps - Add lint task to turbo.json - Add @macalinao/eslint-config and @types/bun to catalog Biome: - Exclude docs/ from biome checks CLI Reorganization: - Restructure CLI to use route maps with one command per file - Move commands to routes/ directory structure - Use func property instead of async loaders - Route maps in _command.ts files for each directory Environment: - Use Bun.env instead of process.env for env vars - Add DATABASE_URL and PORT to turbo.json globalEnv Lint Fixes: - Fix nullish coalescing operator usage - Update deprecated Zod API (z.email() instead of .string().email()) - Fix import sorting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
16
apps/api-server/eslint.config.js
Normal file
16
apps/api-server/eslint.config.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { configs } from "@macalinao/eslint-config";
|
||||
|
||||
export default [
|
||||
...configs.fast,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Disable for stub handlers - will be removed when implemented
|
||||
"@typescript-eslint/require-await": "off",
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -7,7 +7,8 @@
|
||||
"dev": "bun run --hot src/index.ts",
|
||||
"build": "bun build src/index.ts --outdir dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
"lint": "eslint . --cache",
|
||||
"clean": "rm -rf dist .eslintcache"
|
||||
},
|
||||
"dependencies": {
|
||||
"@orpc/server": "^1.13.2",
|
||||
@@ -15,8 +16,10 @@
|
||||
"@reviq/db": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
"@macalinao/eslint-config": "catalog:",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"@types/bun": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ import { router } from "./router.js";
|
||||
|
||||
const handler = new RPCHandler(router);
|
||||
|
||||
const port = import.meta.env.PORT ?? 3001;
|
||||
|
||||
Bun.serve({
|
||||
port: process.env.PORT || 3001,
|
||||
port,
|
||||
async fetch(request) {
|
||||
const url = new URL(request.url);
|
||||
|
||||
@@ -19,4 +21,4 @@ Bun.serve({
|
||||
},
|
||||
});
|
||||
|
||||
console.log("API server running on port", process.env.PORT || 3001);
|
||||
console.log("API server running on port", port);
|
||||
|
||||
Reference in New Issue
Block a user