diff --git a/.eslintrc.json b/.eslintrc.json index 60d067f..6307415 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,5 +9,87 @@ } } ], - "extends": ["next/core-web-vitals", "next/typescript"] + "plugins": [ + "prettier" + ], + "settings": { + "react": { + "version": "detect" + }, + "import/resolver": { + "alias": { + "map": [ + [ + "~", + "./src" + ] + ], + "extensions": [ + ".js", + ".ts", + ".tsx", + ".d.ts", + ".test.ts", + ".json" + ] + } + } + }, + "rules": { + "no-use-before-define": "off", + "class-methods-use-this": "off", + "import/prefer-default-export": "off", + "import/no-cycle": "off", + "no-promise-executor-return": "off", + "@typescript-eslint/no-shadow": "off", + "react/require-default-props": "off", + "no-shadow": "off", + "prettier/prettier": [ + "warn", + { + "printWidth": 80, + "tabWidth": 2, + "endOfLine":"auto", + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "trailingComma": "all", + "bracketSpacing": true, + "arrowParens": "always" + } + ], + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "never", + "jsx": "never", + "ts": "never", + "tsx": "never" + } + ], + "react/jsx-filename-extension": [ + 1, + { + "extensions": [ + ".ts", + ".tsx" + ] + } + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true + } + ] + }, + "extends": [ + "airbnb", + "next/core-web-vitals", + "next/typescript", + "prettier" + ] } diff --git a/package.json b/package.json index 818e3a6..3223cf1 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start --port 4000", - "lint": "next lint", + "lint": "next lint --fix", "test": "vitest", "seed": "node -r dotenv/config ./src/bootstrap/boundaries/db/seed.js" }, @@ -46,10 +46,16 @@ "bcrypt": "^5.1.1", "dotenv": "^16.4.5", "eslint": "^8", + "eslint-config-airbnb": "^19.0.4", "eslint-config-next": "15.0.1", + "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-import-resolver-typescript": "^3.6.3", + "eslint-plugin-prettier": "^5.2.1", "jsdom": "^25.0.1", "moq.ts": "^10.0.8", "postcss": "^8", + "prettier": "^3.3.3", "tailwindcss": "^3.4.1", "typescript": "^5", "vitest": "^2.1.4" diff --git a/src/app/[lang]/dashboard/components/client/create-random-invoice/create-random-invoice.tsx b/src/app/[lang]/dashboard/components/client/create-random-invoice/create-random-invoice.tsx index f3f95a4..68742c2 100644 --- a/src/app/[lang]/dashboard/components/client/create-random-invoice/create-random-invoice.tsx +++ b/src/app/[lang]/dashboard/components/client/create-random-invoice/create-random-invoice.tsx @@ -1,13 +1,13 @@ -"use client" +"use client"; -import Button from "@/app/components/button/button" -import CreateRandomInvoiceButtonVM from "@/app/[lang]/dashboard/vm/create-random-invoice-button-vm" -import { useDI } from "@/bootstrap/di/di-context" -import { useRef } from "react" +import Button from "@/app/components/button/button"; +import CreateRandomInvoiceButtonVM from "@/app/[lang]/dashboard/vm/create-random-invoice-button-vm"; +import { useDI } from "@/bootstrap/di/di-context"; +import { useRef } from "react"; export default function CreateRandomInvoiceContainer() { - const di = useDI() - const vm = useRef(di.resolve(CreateRandomInvoiceButtonVM)) + const di = useDI(); + const vm = useRef(di.resolve(CreateRandomInvoiceButtonVM)); - return