Skip to content

Commit

Permalink
prettier forces no parethesis on regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuzuri247 committed Dec 6, 2024
1 parent 4766719 commit b705aa1
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extends:
parserOptions:
ecmaVersion: 2018


rules:
# Ignore Rules
strict: 0
Expand Down Expand Up @@ -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}]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
52 changes: 52 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/actions/payoutMethods/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand All @@ -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',
}),
Expand Down

0 comments on commit b705aa1

Please sign in to comment.