From 6c63a30430898f81586cdd263992b15086eefee1 Mon Sep 17 00:00:00 2001 From: sirin Date: Sun, 27 Oct 2024 23:07:53 +0700 Subject: [PATCH] chore: add global prettier/lint config --- .eslintrc.json | 11 ++++++++- .prettierrc | 6 +++++ package-lock.json | 39 ++++++++++++++++++++++++++---- package.json | 5 ++-- pnpm-lock.yaml | 60 ++++++++++++++++++++++------------------------- 5 files changed, 81 insertions(+), 40 deletions(-) create mode 100644 .prettierrc diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..49bc1f4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,12 @@ { - "extends": "next/core-web-vitals" + "extends": ["eslint:recommended", "next", "next/core-web-vitals", "prettier"], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": [ + "error", + { + "endOfLine": "auto" + } + ] + } } diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b134cef --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "printWidth": 120, + "tabWidth": 2, + "trailingComma": "es5" +} diff --git a/package-lock.json b/package-lock.json index 0bc78fd..93ecb0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@hookform/resolvers": "^3.9.0", "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-avatar": "^1.1.0", + "@radix-ui/react-checkbox": "^1.1.2", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-hover-card": "^1.1.1", @@ -51,7 +52,7 @@ "react-markdown": "^9.0.1", "recharts": "^2.12.7", "stripe": "^17.1.0", - "sweetalert2": "^11.14.3", + "sweetalert2": "^11.6.13", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "zod": "^3.23.8" @@ -1015,6 +1016,35 @@ } } }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.1.2.tgz", + "integrity": "sha512-/i0fl686zaJbDQLNKrkCbMyDm6FQMt4jg323k7HuqitoANm9sE23Ql8yOK3Wusk34HSLKDChhMux05FnP6KUkw==", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-presence": "1.1.1", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-collection": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.0.tgz", @@ -8586,10 +8616,9 @@ } }, "node_modules/sweetalert2": { - "version": "11.14.3", - "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.14.3.tgz", - "integrity": "sha512-6NuBHWJCv2gtw4y8PUXLB41hty+V6U2mKZMAvydL1IRPcORR0yuyq3cjFD/+ByrCk3muEFggbZX/x6HwmbVfbA==", - "license": "MIT", + "version": "11.14.4", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.14.4.tgz", + "integrity": "sha512-8QMzjxCuinwm18EK5AtYvuhP+lRMRxTWVXy8om9wGlULsXSI4TD29kyih3VYrSXMMBlD4EShFvNC7slhTC7j0w==", "funding": { "type": "individual", "url": "https://github.com/sponsors/limonte" diff --git a/package.json b/package.json index 62afe23..0ef3bd2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\"" }, "dependencies": { "@hookform/resolvers": "^3.9.0", @@ -53,7 +54,7 @@ "react-markdown": "^9.0.1", "recharts": "^2.12.7", "stripe": "^17.1.0", - "sweetalert2": "^11.14.3", + "sweetalert2": "^11.6.13", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "zod": "^3.23.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61a2783..a661c7c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,9 +10,6 @@ dependencies: "@radix-ui/react-avatar": specifier: ^1.1.0 version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) - "@radix-ui/react-checkbox": - specifier: ^1.1.2 - version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) "@radix-ui/react-dialog": specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) @@ -132,7 +129,7 @@ dependencies: version: 17.2.0 sweetalert2: specifier: ^11.14.3 - version: 11.14.4 + version: 11.14.3 tailwind-merge: specifier: ^2.5.2 version: 2.5.2 @@ -784,34 +781,6 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false - /@radix-ui/react-checkbox@1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): - resolution: - { integrity: sha512-/i0fl686zaJbDQLNKrkCbMyDm6FQMt4jg323k7HuqitoANm9sE23Ql8yOK3Wusk34HSLKDChhMux05FnP6KUkw== } - peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-dom": - optional: true - dependencies: - "@radix-ui/primitive": 1.1.0 - "@radix-ui/react-compose-refs": 1.1.0(@types/react@18.3.4)(react@18.3.1) - "@radix-ui/react-context": 1.1.1(@types/react@18.3.4)(react@18.3.1) - "@radix-ui/react-presence": 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) - "@radix-ui/react-primitive": 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) - "@radix-ui/react-use-controllable-state": 1.1.0(@types/react@18.3.4)(react@18.3.1) - "@radix-ui/react-use-previous": 1.1.0(@types/react@18.3.4)(react@18.3.1) - "@radix-ui/react-use-size": 1.1.0(@types/react@18.3.4)(react@18.3.1) - "@types/react": 18.3.4 - "@types/react-dom": 18.3.0 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - dev: false - /@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: { integrity: sha512-GZsZslMJEyo1VKm5L1ZJY8tGDxZNPAoUeQUIbKeJfoi7Q4kmig5AsgLMYYuyYbfjd8fBmFORAIwYAkXMnXZgZw== } @@ -2403,6 +2372,28 @@ packages: dependencies: "@types/react": 18.3.4 + /@types/react-fade-in@2.0.2(react@18.3.1): + resolution: + { integrity: sha512-JdyLYFtyvqDP7mqnKaAyuYD+VMtzAHbUf3kumNQV5QALxjBGmb95HXD0uug1bGol053dtV5yO3NNpGHOMj413g== } + deprecated: This is a stub types definition. react-fade-in provides its own type definitions, so you do not need this installed. + dependencies: + react-fade-in: 2.0.1(react@18.3.1) + transitivePeerDependencies: + - react + dev: true + + /@types/react-lottie@1.2.10: + resolution: + { integrity: sha512-rCd1p3US4ELKJlqwVnP0h5b24zt5p9OCvKUoNpYExLqwbFZMWEiJ6EGLMmH7nmq5V7KomBIbWO2X/XRFsL0vCA== } + dependencies: + "@types/react": 18.3.4 + dev: true + + /@types/react-select-country-list@2.2.3: + resolution: + { integrity: sha512-nffcYOwuun+5B0EWqubK+amHpPdK9Xj20xkLYNqYrzmESd8FnpLwHsS79ClLAWA9y+icVA8gWPkbwBp1gpjSwA== } + dev: true + /@types/react@18.3.4: resolution: { integrity: sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw== } @@ -6822,6 +6813,11 @@ packages: { integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== } engines: { node: ">= 0.4" } + /sweetalert2@11.14.3: + resolution: + { integrity: sha512-6NuBHWJCv2gtw4y8PUXLB41hty+V6U2mKZMAvydL1IRPcORR0yuyq3cjFD/+ByrCk3muEFggbZX/x6HwmbVfbA== } + dev: false + /tailwind-merge@2.5.2: resolution: { integrity: sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg== }