|
| 1 | +const { defineConfig } = require("eslint-define-config"); |
| 2 | + |
| 3 | +module.exports = defineConfig({ |
| 4 | + env: { |
| 5 | + "jest/globals": true, |
| 6 | + }, |
| 7 | + plugins: ["jest", "jest-formatting", "testing-library"], |
| 8 | + rules: { |
| 9 | + // Setting the recommended rules manually, because we don't want warnings, only errors |
| 10 | + "jest/no-alias-methods": "error", // STYLE |
| 11 | + "jest/no-commented-out-tests": "error", |
| 12 | + "jest/no-conditional-expect": "error", |
| 13 | + "jest/no-conditional-in-test": "error", |
| 14 | + "jest/no-deprecated-functions": "error", |
| 15 | + "jest/no-disabled-tests": "error", |
| 16 | + "jest/no-done-callback": "error", |
| 17 | + "jest/no-export": "error", |
| 18 | + "jest/no-focused-tests": "error", |
| 19 | + "jest/no-identical-title": "error", |
| 20 | + "jest/no-mocks-import": "error", |
| 21 | + "jest/no-standalone-expect": "error", |
| 22 | + "jest/no-test-prefixes": "error", // STYLE - force it.skip over xtest |
| 23 | + "jest/no-test-return-statement": "error", |
| 24 | + "jest/prefer-to-have-length": "error", // STYLE |
| 25 | + "jest/valid-describe-callback": "error", |
| 26 | + "jest/valid-expect": "error", |
| 27 | + "jest/valid-expect-in-promise": "error", |
| 28 | + "jest/valid-title": ["error", { disallowedWords: ["should"] }], // STYLE |
| 29 | + "jest-formatting/padding-around-all": "error", // STYLE |
| 30 | + "testing-library/await-async-query": "error", |
| 31 | + "testing-library/no-manual-cleanup": "error", |
| 32 | + "testing-library/no-container": "error", |
| 33 | + "testing-library/no-await-sync-query": "error", |
| 34 | + "testing-library/no-await-sync-events": "error", |
| 35 | + "testing-library/no-debugging-utils": "error", |
| 36 | + "testing-library/await-async-utils": "error", |
| 37 | + "testing-library/no-promise-in-fire-event": "error", |
| 38 | + "testing-library/no-render-in-setup": "error", |
| 39 | + "testing-library/no-unnecessary-act": "error", |
| 40 | + "testing-library/no-wait-for-multiple-assertions": "error", |
| 41 | + "testing-library/prefer-explicit-assert": "error", |
| 42 | + "testing-library/prefer-presence-queries": "error", |
| 43 | + "testing-library/no-wait-for-side-effects": "error", |
| 44 | + "testing-library/prefer-screen-queries": "error", |
| 45 | + }, |
| 46 | +}); |
0 commit comments