-
Notifications
You must be signed in to change notification settings - Fork 694
Expand file tree
/
Copy path.eslintrc.js
More file actions
30 lines (30 loc) · 1.47 KB
/
.eslintrc.js
File metadata and controls
30 lines (30 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = {
root: true,
extends: ['plugin:console/react-typescript-prettier'],
plugins: ['testing-library', 'jest-dom'],
overrides: [
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react', 'plugin:jest-dom/recommended'],
rules: {
// NOTE: Using eslint-plugin-testing-library v3.x (compatible with ESLint 6)
// Some newer rules are not available in this version:
// - prefer-user-event (added in v5.x) - Use code review to enforce userEvent over fireEvent
// - no-node-access (added in v5.x) - Use code review to enforce no container usage
// - prefer-query-by-disappearance - Not available in v3.x
//
// Additional limitations (no ESLint rule exists):
// - No rule to enforce .toBeVisible() over .toBeInTheDocument() for user-facing elements
// See SKILL.md Rule 8 - enforce through code review
//
// Available rules being enforced:
'testing-library/await-fire-event': 'off', // Disabled: fireEvent is sync, userEvent not yet supported (SKILL.md Rule 14)
'testing-library/prefer-find-by': 'error', // Similar to prefer-query-by-disappearance
'testing-library/no-await-sync-query': 'error',
'testing-library/no-wait-for-empty-callback': 'error',
'testing-library/prefer-screen-queries': 'error',
'testing-library/prefer-presence-queries': 'error',
},
},
],
};