diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f8fd032..981afed 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,30 +1,36 @@ module.exports = { - root: true, - env: { browser: true, es2020: true }, - settings: { - react: { version: 'detect' }, - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended-type-checked', - 'plugin:@typescript-eslint/stylistic-type-checked', - 'plugin:react-hooks/recommended', - 'plugin:react/recommended', - 'plugin:react/jsx-runtime' - ], - ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts', 'src/bindings.ts'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], - rules: { - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], - }, - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - project: ['./tsconfig.json', './tsconfig.node.json'], - tsconfigRootDir: __dirname, - } -} + root: true, + env: { browser: true, es2020: true }, + settings: { + react: { version: "detect" }, + }, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:@typescript-eslint/stylistic-type-checked", + "plugin:react-hooks/recommended", + "plugin:react/recommended", + "plugin:react/jsx-runtime", + ], + ignorePatterns: [ + "dist", + ".eslintrc.cjs", + "vite.config.ts", + "src/bindings.ts", + ], + parser: "@typescript-eslint/parser", + plugins: ["react-refresh", "eslint-plugin-paths"], + rules: { + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true }, + ], + "paths/alias": "error", + }, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + project: ["./tsconfig.json", "./tsconfig.node.json"], + tsconfigRootDir: __dirname, + }, +}; diff --git a/bun.lockb b/bun.lockb index c86265e..76915d5 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 7c4334f..af4e0e8 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.16", "eslint": "^8.57.0", + "eslint-plugin-paths": "^1.0.6", "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", diff --git a/src/App.tsx b/src/App.tsx index 364fb6e..2f4280e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,8 +2,8 @@ import { Burger, Group, MantineProvider } from "@mantine/core"; import { AppShell } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { Books } from "./components/pages/Books"; -import { LibraryProvider } from "./lib/contexts/library"; -import { theme } from "./lib/theme"; +import { LibraryProvider } from "$lib/contexts/library"; +import { theme } from "$lib/theme"; import { Sidebar } from "./components/organisms/Sidebar"; function App() { diff --git a/tsconfig.json b/tsconfig.json index 3b4160a..9263f5e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,6 @@ "module": "ESNext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "resolveJsonModule": true, @@ -14,7 +13,6 @@ "noEmit": true, "jsx": "react-jsx", - /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -23,7 +21,7 @@ "baseUrl": ".", "paths": { "@/*": ["src/*"], - "$lib/*": ["src/lib/*"], + "$lib/*": ["src/lib/*"] } }, "include": ["src"],