Skip to content

Commit 4be1743

Browse files
committed
fix: remove adding quotes automatically
1 parent 8155743 commit 4be1743

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

client/src/lib/validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ export const specialStringParams2String = (params: SpecialStringParams[]): strin
7878
}, {})
7979

8080
const targetStr = Object.keys(sourceObj)
81-
.map(key => `${key}: '${sourceObj[key]}'`)
81+
.map(key => `${key}: ${sourceObj[key]}`)
8282
.join(', ')
8383

84-
return `{${targetStr}}`
84+
return `{ ${targetStr} }`
8585
}

server/src/lib/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export const StringRegx = /'([^'\n]+)'|"([^"\n]+)"/gu
66

77
// 标识特殊字符串前缀,表示含有特殊字符需要 react-intl-linter 识别 'react-intl=你好,{name: 约翰}' 或 '$=你好,{name: 约翰}'
8-
export const SpecialStringRegx = /^(?:react-intl|\$)=([^"\n']+)/u
8+
export const SpecialStringRegx = /^(?:react-intl|\$)=([^\n]+)/u
99

1010
// 特殊字符串里面的非法参数,若有一个非法参数则不抛出 codeAction
1111
export const inValidParamsRegx = /\{\s*([A-Za-z_]+):\s*\}/u

0 commit comments

Comments
 (0)