Skip to content

Commit

Permalink
chore: add eslint, prettier and husky support
Browse files Browse the repository at this point in the history
  • Loading branch information
moinulmoin committed May 25, 2023
1 parent a0595f7 commit e6f608f
Show file tree
Hide file tree
Showing 36 changed files with 1,679 additions and 1,417 deletions.
29 changes: 27 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
{
"extends": "next/core-web-vitals"
}
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
]
}
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint && pnpm format
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 2,
"plugins": ["prettier-plugin-tailwindcss"]
}
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"dev": "prisma generate && next dev",
"build": "prisma generate && prisma db push && next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"format": "prettier --write ./src/**/*.{ts,tsx,js,jsx,json}",
"prepare": "husky install"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.6",
Expand All @@ -16,15 +18,10 @@
"@radix-ui/react-dropdown-menu": "^2.0.4",
"@radix-ui/react-slot": "^1.0.1",
"@radix-ui/react-toast": "^1.1.3",
"@types/node": "20.2.3",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"@vercel/analytics": "^1.0.1",
"autoprefixer": "10.4.14",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"eslint": "8.41.0",
"eslint-config-next": "13.4.3",
"lucide-react": "^0.220.0",
"next": "13.4.3",
"next-auth": "^4.22.1",
Expand All @@ -39,5 +36,17 @@
"tailwindcss": "3.3.2",
"tailwindcss-animate": "^1.0.5",
"typescript": "5.0.4"
},
"devDependencies": {
"@types/node": "20.2.3",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"eslint": "8.41.0",
"eslint-config-next": "13.4.3",
"husky": "^8.0.3",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0"
}
}
Loading

0 comments on commit e6f608f

Please sign in to comment.