Skip to content

Commit

Permalink
fix: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
  • Loading branch information
3 people committed Jul 6, 2020
1 parent 3fcf261 commit 3738c2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/rules/no-interpolation-in-snapshots.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Disallow string interpolation inside inline snapshots (`no-interpolation-in-snapshots`)
# Disallow string interpolation inside snapshots (`no-interpolation-in-snapshots`)

Prevents the use of string interpolations in snapshots.

Expand Down
9 changes: 6 additions & 3 deletions src/rules/no-interpolation-in-snapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export default createRule({
meta: {
docs: {
category: 'Best Practices',
description: 'Disallow string interpolation inside inline snapshots.',
description: 'Disallow string interpolation inside inline snapshots',
recommended: false,
},
messages: {
noInterpolation:
'Do not use string interpolation inside of inline snapshots',
},
schema: [],
type: 'suggestion',
type: 'problem',
},
defaultOptions: [],
create(context) {
Expand All @@ -26,8 +26,11 @@ export default createRule({

const { matcher } = parseExpectCall(node);

if (!matcher) {
return;
}

if (
matcher &&
[
'toMatchInlineSnapshot',
'toThrowErrorMatchingInlineSnapshot',
Expand Down

0 comments on commit 3738c2d

Please sign in to comment.