|
12 | 12 | // and we try not to use "ERROR" level at all.
|
13 | 13 |
|
14 | 14 | module.exports = {
|
15 |
| - plugins: ['jest'], |
| 15 | + plugins: ['jest', 'jest-dom', 'testing-library'], |
16 | 16 | overrides: [
|
17 | 17 | {
|
18 | 18 | files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
|
19 | 19 | env: {
|
20 | 20 | 'jest/globals': true,
|
21 | 21 | },
|
22 | 22 | // A subset of the recommended rules:
|
23 |
| - // https://github.com/jest-community/eslint-plugin-jest#rules |
24 | 23 | rules: {
|
25 |
| - 'jest/expect-expect': 'warn', |
26 |
| - 'jest/no-identical-title': 'warn', |
27 |
| - 'jest/valid-describe': 'warn', |
28 |
| - 'jest/valid-expect': 'warn', |
29 |
| - 'jest/valid-expect-in-promise': 'warn', |
| 24 | + // https://github.com/jest-community/eslint-plugin-jest |
| 25 | + 'jest/expect-expect': 'off', |
| 26 | + 'jest/no-commented-out-tests': 'warn', |
| 27 | + 'jest/no-conditional-expect': 'error', |
| 28 | + 'jest/no-deprecated-functions': 'warn', |
| 29 | + 'jest/no-disabled-tests': 'warn', |
| 30 | + 'jest/no-done-callback': 'error', |
| 31 | + 'jest/no-export': 'error', |
| 32 | + 'jest/no-focused-tests': 'warn', |
| 33 | + 'jest/no-identical-title': 'error', |
| 34 | + 'jest/no-interpolation-in-snapshots': 'error', |
| 35 | + 'jest/no-jasmine-globals': 'error', |
| 36 | + 'jest/no-jest-import': 'error', |
| 37 | + 'jest/no-mocks-import': 'error', |
| 38 | + 'jest/no-standalone-expect': 'off', |
| 39 | + 'jest/no-test-callback': 'off', |
| 40 | + 'jest/no-test-prefixes': 'warn', |
| 41 | + 'jest/valid-describe': 'error', |
| 42 | + 'jest/valid-expect': 'error', |
| 43 | + 'jest/valid-expect-in-promise': 'error', |
| 44 | + 'jest/valid-title': 'warn', |
| 45 | + |
| 46 | + // https://github.com/testing-library/eslint-plugin-jest-dom |
| 47 | + 'jest-dom/prefer-checked': 'warn', |
| 48 | + 'jest-dom/prefer-empty': 'warn', |
| 49 | + 'jest-dom/prefer-enabled-disabled': 'warn', |
| 50 | + 'jest-dom/prefer-focus': 'warn', |
| 51 | + 'jest-dom/prefer-required': 'warn', |
| 52 | + 'jest-dom/prefer-to-have-attribute': 'warn', |
| 53 | + 'jest-dom/prefer-to-have-style': 'warn', |
| 54 | + 'jest-dom/prefer-to-have-text-content': 'warn', |
| 55 | + |
| 56 | + // https://github.com/testing-library/eslint-plugin-testing-library |
| 57 | + 'testing-library/await-async-query': 'error', |
| 58 | + 'testing-library/await-async-utils': 'error', |
| 59 | + 'testing-library/no-await-sync-query': 'warn', |
| 60 | + 'testing-library/no-debug': 'warn', |
| 61 | + 'testing-library/no-dom-import': ['error', 'react'], |
| 62 | + 'testing-library/no-manual-cleanup': 'error', |
| 63 | + 'testing-library/no-render-in-setup': 'error', |
| 64 | + 'testing-library/no-wait-for-empty-callback': 'error', |
| 65 | + 'testing-library/no-wait-for-snapshot': 'error', |
| 66 | + 'testing-library/prefer-explicit-assert': 'warn', |
| 67 | + 'testing-library/prefer-find-by': 'warn', |
| 68 | + 'testing-library/prefer-presence-queries': 'warn', |
| 69 | + 'testing-library/prefer-screen-queries': 'warn', |
| 70 | + 'testing-library/prefer-wait-for': 'warn', |
30 | 71 | },
|
31 | 72 | },
|
32 | 73 | ],
|
|
0 commit comments