From 7d4796c8ebd904e132f14b3a284d576c672fc415 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Tue, 6 May 2025 00:35:39 -0500 Subject: [PATCH] chore: update package.json and TypeScript configuration across multiple packages - Added linting and type-checking scripts to package.json for api, web, and ui packages. - Updated ESLint configuration to ignore specific directories and added global window variable. - Modified TypeScript configuration for ui package to exclude turbo generators. - Refactored Button, Card, and Code components to use props for better readability and consistency. --- apps/api/package.json | 2 ++ apps/web/package.json | 2 ++ packages/eslint-config/solid.js | 4 ++++ packages/ui/package.json | 1 + packages/ui/src/button.tsx | 8 ++++---- packages/ui/src/card.tsx | 15 +++++---------- packages/ui/src/code.tsx | 7 ++----- packages/ui/tsconfig.json | 3 ++- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index 5a4a009..e2aa519 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -7,6 +7,8 @@ "test": "test" }, "scripts": { + "lint": "eslint . --max-warnings 0", + "check-types": "tsc --noEmit", "test": "ts-node --test test/**/*.test.ts", "start": "node dist/index.js", "dev": "nodemon --delay 2000ms src/index.ts", diff --git a/apps/web/package.json b/apps/web/package.json index 3848aba..a67ab5c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -4,6 +4,8 @@ "version": "0.0.0", "type": "module", "scripts": { + "lint": "eslint . --max-warnings 0", + "check-types": "tsc --noEmit", "dev": "vite", "build": "tsc -b && vite build", "preview": "vite preview" diff --git a/packages/eslint-config/solid.js b/packages/eslint-config/solid.js index 92c6aaa..d32dc4b 100644 --- a/packages/eslint-config/solid.js +++ b/packages/eslint-config/solid.js @@ -13,11 +13,15 @@ export const config = [ { files: ['**/*.{ts,tsx}'], ...solid, + ignores: ['turbo/generators/**'], languageOptions: { parser: tsParser, parserOptions: { project: 'tsconfig.json', }, + globals: { + window: true, + }, }, }, ]; diff --git a/packages/ui/package.json b/packages/ui/package.json index ceae1b7..de7adbd 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -5,6 +5,7 @@ "exports": { "./*": "./src/*.tsx" }, + "type": "module", "scripts": { "lint": "eslint . --max-warnings 0", "generate:component": "turbo gen react-component", diff --git a/packages/ui/src/button.tsx b/packages/ui/src/button.tsx index 8212175..2a1e82e 100644 --- a/packages/ui/src/button.tsx +++ b/packages/ui/src/button.tsx @@ -8,13 +8,13 @@ interface ButtonProps { appName: string; } -export const Button = ({ children, className, appName }: ButtonProps) => { +export const Button = (props: ButtonProps) => { return ( ); }; diff --git a/packages/ui/src/card.tsx b/packages/ui/src/card.tsx index 19d330d..8e92799 100644 --- a/packages/ui/src/card.tsx +++ b/packages/ui/src/card.tsx @@ -1,11 +1,6 @@ import { type JSX } from 'solid-js/jsx-runtime'; -export function Card({ - className, - title, - children, - href, -}: { +export function Card(props: { className?: string; title: string; children: JSX.Element; @@ -13,15 +8,15 @@ export function Card({ }): JSX.Element { return (

- {title} -> + {props.title} ->

-

{children}

+

{props.children}

); } diff --git a/packages/ui/src/code.tsx b/packages/ui/src/code.tsx index 9ed9271..3d69f1f 100644 --- a/packages/ui/src/code.tsx +++ b/packages/ui/src/code.tsx @@ -1,11 +1,8 @@ import { type JSX } from 'solid-js/jsx-runtime'; -export function Code({ - children, - className, -}: { +export function Code(props: { children: JSX.Element; className?: string; }): JSX.Element { - return {children}; + return {props.children}; } diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 44c6177..da3b702 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -3,5 +3,6 @@ "compilerOptions": { "outDir": "dist" }, - "include": ["src"] + "include": ["src"], + "exclude": ["turbo/generators"] }