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

@@ -241,7 +241,8 @@ const Prompt: FC<ISimplePromptInput> = ({
selectable: !hasSetBlockStatus.query,
}}
onChange={(value) => {
handleChange?.(value, [])
if (handleChange)
handleChange(value, [])
}}
onBlur={() => {
handleChange(promptTemplate, getVars(promptTemplate))

View File

@@ -151,7 +151,7 @@ const ExternalDataToolModal: FC<ExternalDataToolModalProps> = ({
return
}
if (localeData.variable && !/[a-zA-Z_][a-zA-Z0-9_]{0,29}/g.test(localeData.variable)) {
if (localeData.variable && !/[a-zA-Z_]\w{0,29}/g.test(localeData.variable)) {
notify({ type: 'error', message: t('appDebug.varKeyError.notValid', { key: t('appDebug.feature.tools.modal.variableName.title') }) })
return
}