Skip to content

Commit fc81cce

Browse files
committed
feat(main): add numberOnly rule
1 parent eab8586 commit fc81cce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

git-consistent

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ const checkValue = (term, value, definition) => {
132132
if (/\.$/.test(value)) errorMessages.push(`${term} should put dot (.) at the end.`)
133133
}
134134
break
135+
case 'numberOnly':
136+
if (ruleSetting && /^[^0-9].*/.test(value)) {
137+
errorMessages.push(`${term} must be number only.`)
138+
}
139+
break
135140
case 'ascii':
136141
if (!ruleSetting && /[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf]/.test(value)) {
137142
errorMessages.push(`${term} should only alphabet.`)

0 commit comments

Comments
 (0)