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

fix: ensure jest globals are enabled in styles config #1241

Merged
merged 1 commit into from Sep 9, 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
3 changes: 3 additions & 0 deletions src/__tests__/__snapshots__/rules.test.ts.snap
Expand Up @@ -91,6 +91,9 @@ exports[`rules should export configs that refer to actual rules 1`] = `
},
},
"style": {
"env": {
"jest/globals": true,
},
"plugins": [
"jest",
],
Expand Down
15 changes: 6 additions & 9 deletions src/index.ts
Expand Up @@ -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: {
Expand Down