|
| 1 | +module.exports = { |
| 2 | + plugins: ['eslint-plugin-jest'], |
| 3 | + extends: [ |
| 4 | + 'plugin:eslint-plugin-jest/recommended', |
| 5 | + 'plugin:eslint-plugin-jest/style' |
| 6 | + ], |
| 7 | + rules: { |
| 8 | + 'jest/consistent-test-it': 'error', |
| 9 | + 'jest/expect-expect': [ |
| 10 | + 'error', |
| 11 | + // todo: TBD - this will need adjusting for react-testing-library |
| 12 | + { assertFunctionNames: ['expect'] } |
| 13 | + ], |
| 14 | + 'jest/lowercase-name': [ |
| 15 | + 'error', // todo switch to top flag once merged |
| 16 | + { ignore: ['describe'] } |
| 17 | + ], |
| 18 | + 'jest/no-expect-resolves': 'warn', |
| 19 | + 'jest/no-if': 'error', // todo: rename to no-conditional-expect |
| 20 | + 'jest/no-large-snapshots': 'warn', |
| 21 | + 'jest/no-test-return-statement': 'error', |
| 22 | + 'jest/no-truthy-falsy': 'error', |
| 23 | + 'jest/prefer-called-with': 'error', |
| 24 | + // you can disable this if you use a `beforeEach` setup script, |
| 25 | + 'jest/prefer-expect-assertions': 'warn', |
| 26 | + 'jest/prefer-hooks-on-top': 'error', |
| 27 | + 'jest/prefer-inline-snapshots': 'warn', |
| 28 | + 'jest/prefer-spy-on': 'error', |
| 29 | + 'jest/prefer-strict-equal': 'error', |
| 30 | + 'jest/prefer-todo': 'error', |
| 31 | + 'jest/require-to-throw-message': 'error', |
| 32 | + 'jest/require-top-level-describe': 'error', |
| 33 | + 'jest/valid-title': 'error' |
| 34 | + } |
| 35 | +}; |
0 commit comments