Skip to content

Commit

Permalink
Add eslint-plugin-paths as lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
phildenhoff committed Apr 25, 2024
1 parent e7fe3cf commit a545082
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 34 deletions.
64 changes: 35 additions & 29 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -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,
},
};
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand All @@ -23,7 +21,7 @@
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"$lib/*": ["src/lib/*"],
"$lib/*": ["src/lib/*"]
}
},
"include": ["src"],
Expand Down

0 comments on commit a545082

Please sign in to comment.