mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
lint update
This commit is contained in:
parent
3736e2d91e
commit
c6d367a76f
@ -310,11 +310,15 @@ export default {
|
|||||||
fixes.push(fixer.insertTextBefore(firstProp, `ns: '${ns}', `))
|
fixes.push(fixer.insertTextBefore(firstProp, `ns: '${ns}', `))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (hasSecondArg && secondArg.type === 'Literal' && typeof secondArg.value === 'string') {
|
||||||
|
// Second arg is a string (default value): 'default' -> { ns: 'xxx', defaultValue: 'default' }
|
||||||
|
fixes.push(fixer.replaceText(secondArg, `{ ns: '${ns}', defaultValue: ${sourceCode.getText(secondArg)} }`))
|
||||||
|
}
|
||||||
else if (!hasSecondArg) {
|
else if (!hasSecondArg) {
|
||||||
// No second argument, add new object
|
// No second argument, add new object
|
||||||
fixes.push(fixer.insertTextAfter(originalFirstArg, `, { ns: '${ns}' }`))
|
fixes.push(fixer.insertTextAfter(originalFirstArg, `, { ns: '${ns}' }`))
|
||||||
}
|
}
|
||||||
// If second arg exists but is not an object, skip (can't safely add ns)
|
// If second arg exists but is not an object or string, skip (can't safely add ns)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstArg.type === 'Literal' && typeof firstArg.value === 'string') {
|
if (firstArg.type === 'Literal' && typeof firstArg.value === 'string') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user