Skip to content

Commit 758b7cb

Browse files
committed
Revert F03: report one issue for the whole inline snapshot instead of one per interpolation
Reduces noise on snapshots with multiple interpolations, per review feedback.
1 parent adeedf5 commit 758b7cb

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

packages/analysis/src/jsts/rules/S8967/rule.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ export const rule: Rule.RuleModule = {
6161

6262
const snapshot = getInterpolatedInlineSnapshot(context, node, frameworks);
6363
if (snapshot) {
64-
for (const expression of snapshot.expressions) {
65-
context.report({
66-
node: expression,
67-
messageId: 'removeInterpolation',
68-
});
69-
}
64+
context.report({
65+
node: snapshot,
66+
messageId: 'removeInterpolation',
67+
});
7068
}
7169
},
7270
};

packages/analysis/src/jsts/rules/S8967/unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('S8967', () => {
130130
code: `
131131
import { expect, it } from '@jest/globals';
132132
133-
it('reports one issue per interpolation', () => {
133+
it('reports a single issue for a snapshot with multiple interpolations', () => {
134134
const user = getUser();
135135
136136
expect(user).toMatchInlineSnapshot(\`
@@ -141,7 +141,7 @@ describe('S8967', () => {
141141
\`);
142142
});
143143
`,
144-
errors: [{ message: MESSAGE }, { message: MESSAGE }],
144+
errors: [{ message: MESSAGE }],
145145
},
146146
{
147147
code: `

0 commit comments

Comments
 (0)