Skip to content

Commit a165e98

Browse files
authoredSep 9, 2022
fix: ensure jest globals are enabled in styles config (#1241)
1 parent 570a644 commit a165e98

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎src/__tests__/__snapshots__/rules.test.ts.snap

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ exports[`rules should export configs that refer to actual rules 1`] = `
9191
},
9292
},
9393
"style": {
94+
"env": {
95+
"jest/globals": true,
96+
},
9497
"plugins": [
9598
"jest",
9699
],

‎src/index.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,12 @@ export = {
6868
configs: {
6969
all: createConfig(allRules),
7070
recommended: createConfig(recommendedRules),
71-
style: {
72-
plugins: ['jest'],
73-
rules: {
74-
'jest/no-alias-methods': 'warn',
75-
'jest/prefer-to-be': 'error',
76-
'jest/prefer-to-contain': 'error',
77-
'jest/prefer-to-have-length': 'error',
78-
},
79-
},
71+
style: createConfig({
72+
'jest/no-alias-methods': 'warn',
73+
'jest/prefer-to-be': 'error',
74+
'jest/prefer-to-contain': 'error',
75+
'jest/prefer-to-have-length': 'error',
76+
}),
8077
},
8178
environments: {
8279
globals: {

0 commit comments

Comments
 (0)
Please sign in to comment.