Repository navigation
fix(aws): monitoring-stack EVL004 spread source (#1139) - #1929
Merged
Merged
Conversation
CI's EVL regression guard (npx tsx packages/core/src/cli/main.ts lint lexicons/aws/src/composites) flagged monitoring-stack.ts:101:51 — a spread from a same-function `const dims = [...]`. EVL004's isConstIdentifier only walks sourceFile.statements (module-level declarations), so a function-local const, though genuinely const, doesn't trace as one. Sidesteps the gap instead of fighting it: a ternary between two literal arrays, no spread. Verified: the CI lint command exits 0 on lexicons/aws/src/composites (35 pre-existing warnings, 0 errors, EVL004 gone); full aws suite green (122 files, 1598 passed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EVL004atmonitoring-stack.ts:101:51, "Spread from non-const source".EVL004'sisConstIdentifier(packages/core/src/lint/rules/evl004-spread-non-const.ts) only walkssourceFile.statements— module-level declarations — so aconstdeclared inside a function body (thewidget()helper'sconst dims = [...]) never traces as const even though it genuinely is one. The spread...dimsinside the metrics tuple then reads as coming from a non-const source.widget()now builds the metrics tuple as a ternary between two literal arrays ([namespace, metricName, dimName, dimValue]vs[namespace, metricName]), whichEVL004accepts outright (object/array literals are always traceable).Relates to #1139.
Test plan
npx tsx packages/core/src/cli/main.ts lint lexicons/aws/src/composites→ exit 0, 35 pre-existing warnings (same class already present oneks-cluster.ts,fargate-alb.ts, etc.), 0 errors,EVL004gonelexicons/aws/src/composites/monitoring-stack.test.ts+barrel.test.ts— 45 tests passnpx vitest run lexicons/aws— 122 files, 1598 passedCo-Authored-By: Claude Fable 5 noreply@anthropic.com
https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT