chore: eslint add sonar (#17989)

This commit is contained in:
Joel
2025-04-14 15:28:20 +08:00
committed by GitHub
parent 8f9cbe1c49
commit d80f4c7d3b
38 changed files with 157 additions and 180 deletions

View File

@@ -38,7 +38,7 @@ const ObjectValueItem: FC<Props> = ({
const handleKeyChange = useCallback((index: number) => {
return (e: React.ChangeEvent<HTMLInputElement>) => {
const newList = produce(list, (draft: any[]) => {
if (!/^[a-zA-Z0-9_]+$/.test(e.target.value))
if (!/^\w+$/.test(e.target.value))
return notify({ type: 'error', message: 'key is can only contain letters, numbers and underscores' })
draft[index].key = e.target.value
})

View File

@@ -95,7 +95,7 @@ const VariableModal = ({
type === 'number' && 'border-[1.5px] border-components-option-card-option-selected-border bg-components-option-card-option-selected-bg font-medium text-text-primary shadow-xs hover:border-components-option-card-option-selected-border',
)} onClick={() => {
setType('number')
if (!(/^[0-9]$/).test(value))
if (!(/^\d$/).test(value))
setValue('')
}}>Number</div>
<div className={cn(