diff --git a/.eslintrc b/.eslintrc index 55a8a9198..5f6fc89b9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,6 +18,7 @@ extends: parserOptions: ecmaVersion: 2018 + rules: # Ignore Rules strict: 0 @@ -84,7 +85,7 @@ rules: computed-property-spacing: [2, never] space-in-parens: [2, never] space-unary-ops: [2, {words: true, nonwords: false}] - wrap-regex: 2 + wrap-regex: off linebreak-style: 0 semi: [2, always] arrow-spacing: [2, {before: true, after: true}] diff --git a/package.json b/package.json index 13a6060a3..0af7c2d18 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "eslint": "^8.56.0", + "eslint-plugin-prettier": "^5.2.1", "jsdom": "^24.0.0", "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8cd2a180..a13f15938 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -231,6 +231,9 @@ importers: eslint: specifier: ^8.56.0 version: 8.57.0 + eslint-plugin-prettier: + specifier: ^5.2.1 + version: 5.2.1(eslint@8.57.0)(prettier@3.4.2) jsdom: specifier: ^24.0.0 version: 24.1.1(canvas@2.11.2) @@ -757,6 +760,10 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@pkgr/core@0.1.1': + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} @@ -2348,6 +2355,20 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} + eslint-plugin-prettier@5.2.1: + resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' + eslint-config-prettier: '*' + prettier: '>=3.0.0' + peerDependenciesMeta: + '@types/eslint': + optional: true + eslint-config-prettier: + optional: true + eslint-scope@7.2.2: resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2403,6 +2424,9 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -3526,6 +3550,10 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier-linter-helpers@1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} + engines: {node: '>=6.0.0'} + prettier-plugin-tailwindcss@0.6.9: resolution: {integrity: sha512-r0i3uhaZAXYP0At5xGfJH876W3HHGHDp+LCRUJrs57PBeQ6mYHMwr25KH8NPX44F2yGTvdnH7OqCshlQx183Eg==} engines: {node: '>=14.21.3'} @@ -4108,6 +4136,10 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + synckit@0.9.2: + resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} + engines: {node: ^14.18.0 || >=16.0.0} + tailwind-merge@2.5.2: resolution: {integrity: sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==} @@ -4925,6 +4957,8 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true + '@pkgr/core@0.1.1': {} + '@popperjs/core@2.11.8': {} '@prisma/client@5.18.0(prisma@5.18.0)': @@ -6526,6 +6560,13 @@ snapshots: escape-string-regexp@5.0.0: {} + eslint-plugin-prettier@5.2.1(eslint@8.57.0)(prettier@3.4.2): + dependencies: + eslint: 8.57.0 + prettier: 3.4.2 + prettier-linter-helpers: 1.0.0 + synckit: 0.9.2 + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 @@ -6620,6 +6661,8 @@ snapshots: fast-deep-equal@3.1.3: {} + fast-diff@1.3.0: {} + fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -8027,6 +8070,10 @@ snapshots: prelude-ls@1.2.1: {} + prettier-linter-helpers@1.0.0: + dependencies: + fast-diff: 1.3.0 + prettier-plugin-tailwindcss@0.6.9(prettier@3.4.2): dependencies: prettier: 3.4.2 @@ -8677,6 +8724,11 @@ snapshots: symbol-tree@3.2.4: {} + synckit@0.9.2: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.3 + tailwind-merge@2.5.2: {} tailwindcss-animate@1.0.7(tailwindcss@3.4.10(ts-node@10.9.2(@types/node@20.16.0)(typescript@5.5.4))): diff --git a/src/actions/payoutMethods/schema.ts b/src/actions/payoutMethods/schema.ts index 461a934aa..38afdee82 100644 --- a/src/actions/payoutMethods/schema.ts +++ b/src/actions/payoutMethods/schema.ts @@ -3,12 +3,14 @@ import { z } from 'zod'; export const payoutMethodSchema = z.object({ upiId: z .string() + // prettier-ignore .refine((value) => (/^[0-9A-Za-z._-]{2,256}@[A-Za-z]{2,64}$/).test(value), { message: 'Enter a valid UPI address', }) .optional(), solanaAddress: z .string() + // prettier-ignore .refine((value) => (/^[A-Za-z0-9]{44}$/).test(value), { message: 'Enter a valid Solana address', }) @@ -18,12 +20,14 @@ export const payoutMethodSchema = z.object({ export const upiIdInsertSchema = z.object({ upiId: z .string() + // prettier-ignore .refine((value) => (/^[0-9A_Za-z._-]{2,256}@[A_Za-z]{2,64}$/).test(value), { - message: 'Invalid UPI address', + message: 'Invalidy UPI address', }), }); export const solanaAddressInsertSchema = z.object({ + // prettier-ignore solanaAddress: z.string().refine((value) => (/^[A-Za-z0-9]{44}$/).test(value), { message: 'Invalid Solana address', }),