fix: oxlint no unused expressions (#29675)

Co-authored-by: daniel <daniel@example.com>
This commit is contained in:
Angel98518
2025-12-16 18:00:04 +08:00
committed by GitHub
parent b7649f61f8
commit c2f2be6b08
8 changed files with 16 additions and 8 deletions

View File

@@ -84,7 +84,8 @@ const CodeEditor: FC<Props> = ({
const getUniqVarName = (varName: string) => {
if (varList.find(v => v.variable === varName)) {
const match = varName.match(/_(\d+)$/)
const varNameRegex = /_(\d+)$/
const match = varNameRegex.exec(varName)
const index = (() => {
if (match)

View File

@@ -25,7 +25,8 @@ const SupportVarInput: FC<Props> = ({
const renderSafeContent = (inputValue: string) => {
const parts = inputValue.split(/(\{\{[^}]+\}\}|\n)/g)
return parts.map((part, index) => {
const variableMatch = part.match(/^\{\{([^}]+)\}\}$/)
const variableRegex = /^\{\{([^}]+)\}\}$/
const variableMatch = variableRegex.exec(part)
if (variableMatch) {
return (
<VarHighlight