fix(lint): 消除 linter 告警

This commit is contained in:
ryan
2026-07-20 15:52:02 +08:00
parent d58b4b6b0e
commit f28aa6520e
3 changed files with 28 additions and 40 deletions
@@ -153,13 +153,16 @@ function appendAutomaticPresetRule(
? `${config.lookback_minutes}m`
: '1h';
// strip legacy field so saved JSON only keeps lookback duration string
const { lookback_minutes: _legacyLookbackMinutes, ...rest } = config;
const {
lookback_minutes: _legacyLookbackMinutes,
lookback: _existingLookback,
...rest
} = config;
return JSON.stringify(
{
lookback,
ttl: typeof rest.ttl === 'number' ? rest.ttl : -1,
...rest,
lookback,
ttl: typeof rest.ttl === 'number' ? rest.ttl : -1,
rules: nextRules,
},
null,