diff --git a/bun.lockb b/bun.lockb index 56b2972..75cbda7 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..c3b20b0 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,27 @@ +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", + }, + }, +] diff --git a/package.json b/package.json index 724a55b..057e4fb 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,21 @@ "tiny-markdown-editor": "^0.1.26" }, "devDependencies": { + "@eslint/js": "^9.13.0", "@tauri-apps/cli": "^1", "autoprefixer": "^10.4.18", "commitizen": "^4.3.1", "cz-conventional-changelog": "^3.3.0", + "eslint": "^9.13.0", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.11.0", "postcss": "^8.4.35", + "prettier": "^3.3.3", "tailwindcss": "^3.4.1", "typescript": "^5.0.2", + "typescript-eslint": "^8.11.0", "vite": "^5.0.0", + "vite-plugin-eslint": "^1.8.1", "vite-plugin-kaioken": "^0.13.1" }, "config": { diff --git a/vite.config.ts b/vite.config.ts index de04713..8d9890a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,21 @@ 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, + exclude: ["src-tauri/**/*"], + emitError: true, + emitWarning: true, + failOnError: false, + failOnWarning: false, + lintOnStart: true, + }), + ], // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` // // 1. prevent vite from obscuring rust errors