diff --git a/bun.lockb b/bun.lockb index 9fec297..d19b06b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..7034435 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,40 @@ +import globals from "globals" +import pluginJs from "@eslint/js" +import tseslint from "typescript-eslint" +import pluginReact from "eslint-plugin-react" + +export default [ + { files: ["./src/**/*.{js,mjs,cjs,ts,jsx,tsx}"] }, + { plugins: { react: pluginReact } }, + { + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + globals: globals.browser, + }, + }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + pluginReact.configs.flat.recommended, + { + rules: { + "react/react-in-jsx-scope": "off", + "react/no-unknown-property": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + args: "all", + argsIgnorePattern: "^_", + caughtErrors: "all", + caughtErrorsIgnorePattern: "^_", + destructuredArrayIgnorePattern: "^_", + varsIgnorePattern: "^_", + ignoreRestSiblings: true, + }, + ], + }, + }, +] diff --git a/package.json b/package.json index 1684a89..d22827b 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,18 @@ "kaioken": "^0.31.0" }, "devDependencies": { + "@eslint/js": "^9.13.0", "@tauri-apps/cli": "^2.0.1", "autoprefixer": "^10.4.20", + "eslint": "^9.13.0", + "eslint-plugin-react": "^7.37.2", "postcss": "^8.4.47", + "prettier": "^3.3.3", "tailwindcss": "^3.4.13", "typescript": "^5.6.2", + "typescript-eslint": "^8.11.0", "vite": "^5.4.8", + "vite-plugin-eslint": "^1.8.1", "vite-plugin-kaioken": "^0.13.1" } } diff --git a/tsconfig.json b/tsconfig.json index 618eae5..6a201da 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,8 +15,8 @@ /* Linting */ "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedLocals": false, + "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, "jsx": "preserve" }, diff --git a/vite.config.ts b/vite.config.ts index 455ed70..c03305d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,21 @@ -import { defineConfig } from "vite"; -import kaioken from "vite-plugin-kaioken"; +import { defineConfig } from "vite" +import kaioken from "vite-plugin-kaioken" +import eslint from "vite-plugin-eslint" // https://vitejs.dev/config/ export default defineConfig({ - plugins: [kaioken()], + plugins: [ + kaioken(), + eslint({ + cache: true, + ignorePatterns: ["src-tauri"], + emitError: true, + emitWarning: true, + failOnError: false, + failOnWarning: false, + lintOnStart: true, + }), + ], esbuild: { jsxInject: `import * as kaioken from "kaioken"`, jsx: "transform", @@ -25,4 +37,4 @@ export default defineConfig({ ignored: ["**/src-tauri/**"], }, }, -}); +})