From 3705dff9d4f77d21013e263478d8a374d9325acb Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 31 Jul 2020 10:43:46 +1200 Subject: [PATCH] feat: add `no-interpolation-in-snapshots` to the recommended ruleset BREAKING CHANGE: recommend `no-interpolation-in-snapshots` rule --- README.md | 2 +- src/__tests__/__snapshots__/rules.test.ts.snap | 1 + src/rules/no-interpolation-in-snapshots.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65fb07032..489029171 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ installations requiring long-term consistency. | [no-hooks](docs/rules/no-hooks.md) | Disallow setup and teardown hooks | | | | [no-identical-title](docs/rules/no-identical-title.md) | Disallow identical titles | ![recommended][] | | | [no-if](docs/rules/no-if.md) | Disallow conditional logic | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | Disallow string interpolation inside snapshots | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | Disallow string interpolation inside snapshots | ![recommended][] | | | [no-jasmine-globals](docs/rules/no-jasmine-globals.md) | Disallow Jasmine globals | ![recommended][] | ![fixable][] | | [no-jest-import](docs/rules/no-jest-import.md) | Disallow importing Jest | ![recommended][] | | | [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | | diff --git a/src/__tests__/__snapshots__/rules.test.ts.snap b/src/__tests__/__snapshots__/rules.test.ts.snap index b134b3331..21de3f8e6 100644 --- a/src/__tests__/__snapshots__/rules.test.ts.snap +++ b/src/__tests__/__snapshots__/rules.test.ts.snap @@ -71,6 +71,7 @@ Object { "jest/no-export": "error", "jest/no-focused-tests": "error", "jest/no-identical-title": "error", + "jest/no-interpolation-in-snapshots": "error", "jest/no-jasmine-globals": "error", "jest/no-jest-import": "error", "jest/no-mocks-import": "error", diff --git a/src/rules/no-interpolation-in-snapshots.ts b/src/rules/no-interpolation-in-snapshots.ts index 11d68e38d..b267d3694 100644 --- a/src/rules/no-interpolation-in-snapshots.ts +++ b/src/rules/no-interpolation-in-snapshots.ts @@ -7,7 +7,7 @@ export default createRule({ docs: { category: 'Best Practices', description: 'Disallow string interpolation inside snapshots', - recommended: false, + recommended: 'error', }, messages: { noInterpolation: 'Do not use string interpolation inside of snapshots',