diff --git a/bun.lockb b/bun.lockb index 530e111..cb60334 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/client/eslint.config.js b/client/eslint.config.js deleted file mode 100644 index 8ee6ac6..0000000 --- a/client/eslint.config.js +++ /dev/null @@ -1,30 +0,0 @@ -import pluginReact from "eslint-plugin-react"; -import pluginReactHooks from "eslint-plugin-react-hooks"; -import pluginReactRefresh from "eslint-plugin-react-refresh"; -import pluginReactRecommended from "eslint-plugin-react/configs/recommended"; -import globals from "globals"; -import baseConfig from "../eslint.config"; -/** @type {import('eslint').Linter.FlatConfig[]} */ -export default [ - ...baseConfig, - pluginReactRecommended, - pluginReactHooks, - { - files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"], - plugins: { - react: pluginReact, - "react-refresh": pluginReactRefresh, - }, - languageOptions: { - parserOptions: { - ecmaFeatures: "latest", - sourceType: "module", - project: ["./tsconfig.json"], - tsconfigRootDir: "./", - }, - globals: { - ...globals.browser, - }, - }, - }, -]; diff --git a/client/package.json b/client/package.json index 2a5da18..d462c61 100644 --- a/client/package.json +++ b/client/package.json @@ -1,26 +1,26 @@ { - "dependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "devDependencies": { - "@tsconfig/vite-react": "^3.0.0", - "@types/react": "^18.2.56", - "@types/react-dom": "^18.2.19", - "@vitejs/plugin-react": "^4.2.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.5", - "vite": "^5.1.4" - }, - "name": "@appname/client", - "private": true, - "scripts": { - "build": "tsc && vite build", - "dev": "vite", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" - }, - "type": "module", - "version": "0.0.0" + "dependencies": { + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/typography": "^0.5.10", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "tailwindcss-animate": "^1.0.7" + }, + "devDependencies": { + "@tsconfig/vite-react": "^3.0.0", + "@types/react": "^18.2.56", + "@types/react-dom": "^18.2.19", + "@vitejs/plugin-react": "^4.2.1", + "vite": "^5.1.4" + }, + "name": "@appname/client", + "private": true, + "scripts": { + "build": "tsc && vite build", + "dev": "vite", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "type": "module", + "version": "0.0.0" } diff --git a/client/tailwind.config.ts b/client/tailwind.config.ts index 5153a2e..2c7912a 100644 --- a/client/tailwind.config.ts +++ b/client/tailwind.config.ts @@ -1,4 +1,23 @@ -export default { - content: ["./src/**/*.{js,ts,jsx,tsx}"], - plugins: [require("daisyui")], +import forms from "@tailwindcss/forms"; +import typography from "@tailwindcss/typography"; +import daisyUI from "daisyui"; +import type { Config } from "tailwindcss"; +import twanimate from "tailwindcss-animate"; + +const config: Config = { + darkMode: "class", + content: [ + "./pages/**/*.{ts,tsx}", + "./components/**/*.{ts,tsx}", + "./app/**/*.{ts,tsx}", + "./src/**/*.{ts,tsx}", + "./index.html", + ], + prefix: "", + plugins: [twanimate, forms, typography, daisyUI], + daisyui: { + themes: ["light", "dark"], + }, }; + +export default config; diff --git a/client/tsconfig.json b/client/tsconfig.json index 22c545f..74fc7d7 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -1,39 +1,57 @@ { "compilerOptions": { - // Specifying ECMAScript targets for the compiler - "target": "ESNext", - "module": "ESNext", - "lib": ["DOM", "DOM.Iterable", "ESNext"], - // Enabling options for better interoperability and module handling - "moduleResolution": "Bundler", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - // Configuring behavior for JSX, specific to React - "jsx": "react-jsx", // Transform JSX for React 17+ JSX Transform - // Strengthening type-checking and ensuring consistency - "strict": true, // Enable all strict type-checking options - "strictNullChecks": true, // Enable strict null checks - "noUnusedLocals": true, // Disallow unused local variables - "noUnusedParameters": true, // Disallow unused function parameters - "noFallthroughCasesInSwitch": true, // Prevent fallthrough cases in switch statements - "forceConsistentCasingInFileNames": true, // Ensure consistent file naming - // Improving project robustness - "isolatedModules": true, // Ensure correct transpiling of files - "noErrorTruncation": true, // Show full type error messages - "useDefineForClassFields": true, // Align class field behavior with the standard - // Configuring project build process - "allowJs": true, // Allow JavaScript files to be imported - "skipLibCheck": true, // Skip type checking of declaration files - "noEmit": true, // Vite handles the emitting of files - "paths": { - "@root/*": ["./*"], - "@/*": ["./src/*"] - } // Allow absolute imports from src. Create a path alias for the root directory - @root + // Specifying ECMAScript targets for the compiler + // "composite": true, // Enable project references + "target": "ESNext", + "module": "ESNext", + "lib": [ + "DOM", + "DOM.Iterable", + "ESNext" + ], + // Enabling options for better interoperability and module handling + "moduleResolution": "Bundler", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + // Configuring behavior for JSX, specific to React + "jsx": "react-jsx", // Transform JSX for React 17+ JSX Transform + // Strengthening type-checking and ensuring consistency + "strict": true, // Enable all strict type-checking options + "strictNullChecks": true, // Enable strict null checks + "noUnusedLocals": true, // Disallow unused local variables + "noUnusedParameters": true, // Disallow unused function parameters + "noFallthroughCasesInSwitch": true, // Prevent fallthrough cases in switch statements + "forceConsistentCasingInFileNames": true, // Ensure consistent file naming + // Improving project robustness + "isolatedModules": true, // Ensure correct transpiling of files + "noErrorTruncation": true, // Show full type error messages + "useDefineForClassFields": true, // Align class field behavior with the standard + // Configuring project build process + "allowJs": true, // Allow JavaScript files to be imported + "skipLibCheck": true, // Skip type checking of declaration files + "noEmit": true, // Vite handles the emitting of files + "paths": { + "@root/*": [ + "./*" + ], + "@/*": [ + "./src/*" + ] + } // Allow absolute imports from src. Create a path alias for the root directory - @root }, // Specifying folders and files to include in compilation - "include": ["src/**/*", "server/index.ts", "server/services"], + "include": [ + "src/**/*" + ], // Excluding certain directories from the compilation - "exclude": ["node_modules"] -} + "exclude": [ + "node_modules" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/client/tsconfig.node.json b/client/tsconfig.node.json index 1cbc80a..a4f1214 100644 --- a/client/tsconfig.node.json +++ b/client/tsconfig.node.json @@ -9,6 +9,7 @@ }, "include": [ "vite.config.ts", + "tailwind.config.ts", ], "ts-node": { "esm": true diff --git a/client/vite.config.ts b/client/vite.config.ts index d60e3b7..68d228b 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -1,10 +1,10 @@ import react from "@vitejs/plugin-react"; -import { defineConfig, loadEnv } from "vite"; import path from "path"; +import { defineConfig, loadEnv } from "vite"; // https://vitejs.dev/config/ -export default ({ mode }) => { +export default defineConfig(({ mode }) => { process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }; return defineConfig({ resolve: { @@ -16,4 +16,4 @@ export default ({ mode }) => { plugins: [react()], server: { proxy: { "/api": "http://localhost:3000" } }, }); -}; +}); diff --git a/eslint.config.js b/eslint.config.js index f11c6f7..ef3026e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,10 @@ import eslintPluginJs from "@eslint/js"; import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; +import pluginReactRefresh from "eslint-plugin-react-refresh"; +import pluginReact from "eslint-plugin-react"; import tseslint from "typescript-eslint"; +import globals from "globals"; + /** @type {import('eslint').Linter.FlatConfig[]} */ export default [ eslintPluginJs.configs.recommended, @@ -8,6 +12,7 @@ export default [ ...tseslint.configs.stylistic, eslintPluginPrettierRecommended, { + files: ["./server/**/*.{js,jsx,mjs,cjs,ts,tsx}", "./shared/**/*.{js,jsx,mjs,cjs,ts,tsx}"], ignores: ["node_modules/", "dist/", "build/", "coverage/", "public/", "**/eslint.config.js"], languageOptions: { parserOptions: { @@ -16,4 +21,35 @@ export default [ }, }, }, + { + files: ["./client/**/*.{js,jsx,mjs,cjs,ts,tsx}"], + plugins: { + react: pluginReact, + "react-refresh": pluginReactRefresh, + }, + ignores: [ + "client/**/node_modules/", + "client/**/dist/**", + "client/**/build/**", + "client/**/coverage/**", + "client/**/public/**", + "client/*.{js,ts}", + ], + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + project: ["./client/tsconfig.json"], + tsconfigRootDir: "./client", + }, + globals: { + ...globals.browser, + }, + }, + rules: { + "reactPlugin/jsx-uses-react": "error", + "reactPlugin/jsx-uses-vars": "error", + }, + }, ]; diff --git a/package.json b/package.json index 274bc72..306a316 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.5", "postcss": "^8.4.35", "prettier": "^3.2.5", "tailwindcss": "^3.4.1", diff --git a/tsconfig.json b/tsconfig.json index dc9d5c5..c7b989a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,11 +38,12 @@ "@client/*": [ "./client/*" ] - } + }, + "rootDir": "." }, "include": [ "shared/**/*", - "server/**/*", + "server/**/*" ], "exclude": [ "node_modules",