|
1 | | -import { readdirSync } from 'fs'; |
2 | | -import { join, parse } from 'path'; |
| 1 | +import awaitAsyncEvents from './await-async-events'; |
| 2 | +import awaitAsyncQueries from './await-async-queries'; |
| 3 | +import awaitAsyncUtils from './await-async-utils'; |
| 4 | +import consistentDataTestid from './consistent-data-testid'; |
| 5 | +import noAwaitSyncEvents from './no-await-sync-events'; |
| 6 | +import noAwaitSyncQueries from './no-await-sync-queries'; |
| 7 | +import noContainer from './no-container'; |
| 8 | +import noDebuggingUtils from './no-debugging-utils'; |
| 9 | +import noDomImport from './no-dom-import'; |
| 10 | +import noGlobalRegexpFlagInQuery from './no-global-regexp-flag-in-query'; |
| 11 | +import noManualCleanup from './no-manual-cleanup'; |
| 12 | +import noNodeAccess from './no-node-access'; |
| 13 | +import noPromiseInFireEvent from './no-promise-in-fire-event'; |
| 14 | +import noRenderInLifecycle from './no-render-in-lifecycle'; |
| 15 | +import noTestIdQueries from './no-test-id-queries'; |
| 16 | +import noUnnecessaryAct from './no-unnecessary-act'; |
| 17 | +import noWaitForMultipleAssertions from './no-wait-for-multiple-assertions'; |
| 18 | +import noWaitForSideEffects from './no-wait-for-side-effects'; |
| 19 | +import noWaitForSnapshot from './no-wait-for-snapshot'; |
| 20 | +import preferExplicitAssert from './prefer-explicit-assert'; |
| 21 | +import preferFindBy from './prefer-find-by'; |
| 22 | +import preferImplicitAssert from './prefer-implicit-assert'; |
| 23 | +import preferPresenceQueries from './prefer-presence-queries'; |
| 24 | +import preferQueryByDisappearance from './prefer-query-by-disappearance'; |
| 25 | +import preferQueryMatchers from './prefer-query-matchers'; |
| 26 | +import preferScreenQueries from './prefer-screen-queries'; |
| 27 | +import preferUserEvent from './prefer-user-event'; |
| 28 | +import renderResultNamingConvention from './render-result-naming-convention'; |
3 | 29 |
|
4 | | -import { importDefault } from '../utils'; |
5 | | - |
6 | | -import type { TestingLibraryPluginRuleModule } from '../utils'; |
7 | | - |
8 | | -const rulesDir = __dirname; |
9 | | -const excludedFiles = ['index']; |
10 | | - |
11 | | -export default readdirSync(rulesDir) |
12 | | - .map((rule) => parse(rule).name) |
13 | | - .filter((ruleName) => !excludedFiles.includes(ruleName)) |
14 | | - .reduce<Record<string, TestingLibraryPluginRuleModule<string, unknown[]>>>( |
15 | | - (allRules, ruleName) => ({ |
16 | | - ...allRules, |
17 | | - [ruleName]: importDefault< |
18 | | - TestingLibraryPluginRuleModule<string, unknown[]> |
19 | | - >(join(rulesDir, ruleName)), |
20 | | - }), |
21 | | - {} |
22 | | - ); |
| 30 | +export default { |
| 31 | + 'await-async-events': awaitAsyncEvents, |
| 32 | + 'await-async-queries': awaitAsyncQueries, |
| 33 | + 'await-async-utils': awaitAsyncUtils, |
| 34 | + 'consistent-data-testid': consistentDataTestid, |
| 35 | + 'no-await-sync-events': noAwaitSyncEvents, |
| 36 | + 'no-await-sync-queries': noAwaitSyncQueries, |
| 37 | + 'no-container': noContainer, |
| 38 | + 'no-debugging-utils': noDebuggingUtils, |
| 39 | + 'no-dom-import': noDomImport, |
| 40 | + 'no-global-regexp-flag-in-query': noGlobalRegexpFlagInQuery, |
| 41 | + 'no-manual-cleanup': noManualCleanup, |
| 42 | + 'no-node-access': noNodeAccess, |
| 43 | + 'no-promise-in-fire-event': noPromiseInFireEvent, |
| 44 | + 'no-render-in-lifecycle': noRenderInLifecycle, |
| 45 | + 'no-test-id-queries': noTestIdQueries, |
| 46 | + 'no-unnecessary-act': noUnnecessaryAct, |
| 47 | + 'no-wait-for-multiple-assertions': noWaitForMultipleAssertions, |
| 48 | + 'no-wait-for-side-effects': noWaitForSideEffects, |
| 49 | + 'no-wait-for-snapshot': noWaitForSnapshot, |
| 50 | + 'prefer-explicit-assert': preferExplicitAssert, |
| 51 | + 'prefer-find-by': preferFindBy, |
| 52 | + 'prefer-implicit-assert': preferImplicitAssert, |
| 53 | + 'prefer-presence-queries': preferPresenceQueries, |
| 54 | + 'prefer-query-by-disappearance': preferQueryByDisappearance, |
| 55 | + 'prefer-query-matchers': preferQueryMatchers, |
| 56 | + 'prefer-screen-queries': preferScreenQueries, |
| 57 | + 'prefer-user-event': preferUserEvent, |
| 58 | + 'render-result-naming-convention': renderResultNamingConvention, |
| 59 | +}; |
0 commit comments