Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(prefer-called-with): rename name data property to matcherName #1178

Merged
merged 1 commit into from Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rules/__tests__/prefer-called-with.test.ts
Expand Up @@ -26,7 +26,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toBeCalled' },
data: { matcherName: 'toBeCalled' },
column: 12,
line: 1,
},
Expand All @@ -37,7 +37,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toBeCalled' },
data: { matcherName: 'toBeCalled' },
column: 21,
line: 1,
},
Expand All @@ -48,7 +48,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toHaveBeenCalled' },
data: { matcherName: 'toHaveBeenCalled' },
column: 12,
line: 1,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/prefer-called-with.ts
Expand Up @@ -15,7 +15,7 @@ export default createRule({
recommended: false,
},
messages: {
preferCalledWith: 'Prefer {{name}}With(/* expected args */)',
preferCalledWith: 'Prefer {{ matcherName }}With(/* expected args */)',
},
type: 'suggestion',
schema: [],
Expand All @@ -40,7 +40,7 @@ export default createRule({

if (['toBeCalled', 'toHaveBeenCalled'].includes(matcher.name)) {
context.report({
data: { name: matcher.name },
data: { matcherName: matcher.name },
messageId: 'preferCalledWith',
node: matcher.node.property,
});
Expand Down