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

Turn off 2 rules #12

Merged
merged 2 commits into from
Jun 26, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ module.exports = {
plugins: ['jest'],
extends: ['plugin:jest/recommended', 'plugin:jest-formatting/recommended'],
rules: {
'jest/prefer-expect-assertions': 'off', // While useful, enforcing this can lead to verbose tests.
'jest/prefer-each': 'off', // We find traditional for-loops more readable in certain contexts.
'jest/require-top-level-describe': 'off', // Multiple top-level describe blocks or tests can be acceptable.
'jest/max-expects': 'off', // Limiting expect statements is beneficial, but enforcing a strict count can be restrictive.
'jest/valid-title': 'off', // This restriction can prevent using titles like "<function-name>.name".
'jest/no-hooks': [
'error', // We advocate for setup functions over beforeXXX hooks. However, afterXyz hooks are sometimes indispensable, like for resetting Jest timers. See: https://kentcdodds.com/blog/avoid-nesting-when-youre-testing#inline-it.
{
allow: ['afterEach', 'afterAll'],
},
],
'prefer-lowercase-title': 'off', // Sometimes we want to start the test with a capital letter and some words are all uppercase (e.g. AWS).
'jest/prefer-each': 'off', // We find traditional for-loops more readable in certain contexts.
'jest/prefer-expect-assertions': 'off', // While useful, enforcing this can lead to verbose tests.
'jest/prefer-importing-jest-globals': 'off', // This would be very bothersome for existing repos.
'jest/require-top-level-describe': 'off', // Multiple top-level describe blocks or tests can be acceptable.
'jest/valid-title': 'off', // This restriction can prevent using titles like "<function-name>.name".
'prefer-lowercase-title': 'off', // Sometimes we want to start the test with a capital letter and some words are all uppercase (e.g. AWS).,
},
},
],
Expand Down
1 change: 1 addition & 0 deletions src/universal.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
'unicorn/no-object-as-default-parameter': 'off', // Too restrictive. TypeScript can ensure that the default value matches the type.
'unicorn/no-useless-undefined': ['error', { checkArguments: false }], // We need to disable "checkArguments", because if a function expects a value of type "T | undefined" the undefined value needs to be passed explicitly.
'unicorn/prefer-module': 'off', // We use CJS for configuration files and tests. There is no rush to migrate to ESM and the configuration files are probably not yet ready for ESM yet.
'unicorn/prefer-string-raw': 'off', // We commonly escape \ in strings.
'unicorn/prevent-abbreviations': 'off', // This rule reports many false positives and leads to more verbose code.

/* Rule overrides for "import" plugin */
Expand Down
Loading