Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# npm run format && npm run lint
npx lint-staged
# npx lint-staged
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"ms-vscode.vscode-typescript-next"
]
}
45 changes: 45 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// {
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
// "source.fixAll.eslint": "explicit"
// },
// "editor.formatOnSave": true,
// "[typescript]": {
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
// "source.fixAll.eslint": "explicit"
// }
// },
// "[typescriptreact]": {
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
// "source.fixAll.eslint": "explicit"
// }
// },
// "[javascript]": {
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
// "source.fixAll.eslint": "explicit"
// }
// },
// "[javascriptreact]": {
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
// "source.fixAll.eslint": "explicit"
// }
// },
// "eslint.validate": [
// "javascript",
// "javascriptreact",
// "typescript",
// "typescriptreact"
// ],
// "files.autoSave": "onFocusChange",
// "files.watcherExclude": {
// "**/.git/objects/**": true,
// "**/.git/subtree-cache/**": true,
// "**/node_modules/**": true,
// "**/.next/**": true,
// "**/dist/**": true
// }
// }
35 changes: 34 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";

import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import simpleImportSort from "eslint-plugin-simple-import-sort";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -21,6 +24,36 @@ const config = [
],
},
...compat.extends("next/core-web-vitals"),
{
plugins: {
"simple-import-sort": simpleImportSort,
"import": importPlugin,
},
rules: {
"simple-import-sort/imports": [
"error",
{
groups: [
["^node:"],
["^react", "^next"],
["^@?\\w"], // external packages (third-party libraries)
["^@/"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"], // relative imports starting with ../
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"], // relative imports starting with ./
["^.+\\.s?css$"],
],
},
],
"simple-import-sort/exports": "error",

// additional import rules
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-unresolved": "off", // turn off as Next.js handles module resolution
"import/order": "off", // we use simple-import-sort instead
},
},
];

export default config;
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,mdx,css,yaml,yml}\"",
"format:imports": "eslint \"src/**/*.{ts,tsx}\" --fix",
"check": "prettier --check \"**/*.{ts,tsx,js,jsx,md,mdx,css,yaml,yml}\"",
"prepare": "husky"
},
Expand All @@ -17,7 +19,8 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@hookform/resolvers": "^3.9.1",
"axios": "^1.7.7",
"@tanstack/react-query": "^5.90.2",
"axios": "^1.12.2",
"framer-motion": "^11.11.11",
"next": "latest",
"next-auth": "^4.24.10",
Expand All @@ -41,6 +44,8 @@
"@types/react-google-recaptcha": "^2.1.9",
"eslint": "latest",
"eslint-config-next": "latest",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
Expand All @@ -51,7 +56,8 @@
"prettier --write"
],
"src/**/*.{ts,tsx,js,jsx}": [
"eslint"
"eslint --fix"
]
}
},
"packageManager": "[email protected]"
}
Loading