From a165e98b2a8728c427d6c484122dc9e64629052b Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sat, 10 Sep 2022 11:03:26 +1200 Subject: [PATCH] fix: ensure jest globals are enabled in `styles` config (#1241) --- src/__tests__/__snapshots__/rules.test.ts.snap | 3 +++ src/index.ts | 15 ++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/__tests__/__snapshots__/rules.test.ts.snap b/src/__tests__/__snapshots__/rules.test.ts.snap index 2bff9293b..34c265f89 100644 --- a/src/__tests__/__snapshots__/rules.test.ts.snap +++ b/src/__tests__/__snapshots__/rules.test.ts.snap @@ -91,6 +91,9 @@ exports[`rules should export configs that refer to actual rules 1`] = ` }, }, "style": { + "env": { + "jest/globals": true, + }, "plugins": [ "jest", ], diff --git a/src/index.ts b/src/index.ts index 2297d3bb7..44254e380 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,15 +68,12 @@ export = { configs: { all: createConfig(allRules), recommended: createConfig(recommendedRules), - style: { - plugins: ['jest'], - rules: { - 'jest/no-alias-methods': 'warn', - 'jest/prefer-to-be': 'error', - 'jest/prefer-to-contain': 'error', - 'jest/prefer-to-have-length': 'error', - }, - }, + style: createConfig({ + 'jest/no-alias-methods': 'warn', + 'jest/prefer-to-be': 'error', + 'jest/prefer-to-contain': 'error', + 'jest/prefer-to-have-length': 'error', + }), }, environments: { globals: {