|
12 | 12 | // and we try not to use "ERROR" level at all.
|
13 | 13 |
|
14 | 14 | module.exports = {
|
15 |
| - plugins: ['jest'], |
| 15 | + plugins: ['jest', '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/no-conditional-expect': 'error', |
| 26 | + 'jest/no-identical-title': 'error', |
| 27 | + 'jest/no-interpolation-in-snapshots': 'error', |
| 28 | + 'jest/no-jasmine-globals': 'error', |
| 29 | + 'jest/no-jest-import': 'error', |
| 30 | + 'jest/no-mocks-import': 'error', |
| 31 | + 'jest/valid-describe': 'error', |
| 32 | + 'jest/valid-expect': 'error', |
| 33 | + 'jest/valid-expect-in-promise': 'error', |
| 34 | + 'jest/valid-title': 'warn', |
| 35 | + |
| 36 | + // https://github.com/testing-library/eslint-plugin-testing-library |
| 37 | + 'testing-library/await-async-query': 'error', |
| 38 | + 'testing-library/await-async-utils': 'error', |
| 39 | + 'testing-library/no-await-sync-query': 'warn', |
| 40 | + 'testing-library/no-dom-import': ['error', 'react'], |
| 41 | + 'testing-library/no-wait-for-empty-callback': 'error', |
| 42 | + 'testing-library/no-wait-for-snapshot': 'error', |
30 | 43 | },
|
31 | 44 | },
|
32 | 45 | ],
|
|
0 commit comments