index.js
3.95 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var await_async_query_1 = __importDefault(require("./rules/await-async-query"));
var await_async_utils_1 = __importDefault(require("./rules/await-async-utils"));
var await_fire_event_1 = __importDefault(require("./rules/await-fire-event"));
var consistent_data_testid_1 = __importDefault(require("./rules/consistent-data-testid"));
var no_await_sync_events_1 = __importDefault(require("./rules/no-await-sync-events"));
var no_await_sync_query_1 = __importDefault(require("./rules/no-await-sync-query"));
var no_debug_1 = __importDefault(require("./rules/no-debug"));
var no_dom_import_1 = __importDefault(require("./rules/no-dom-import"));
var no_manual_cleanup_1 = __importDefault(require("./rules/no-manual-cleanup"));
var no_render_in_setup_1 = __importDefault(require("./rules/no-render-in-setup"));
var no_wait_for_empty_callback_1 = __importDefault(require("./rules/no-wait-for-empty-callback"));
var no_wait_for_snapshot_1 = __importDefault(require("./rules/no-wait-for-snapshot"));
var prefer_explicit_assert_1 = __importDefault(require("./rules/prefer-explicit-assert"));
var prefer_presence_queries_1 = __importDefault(require("./rules/prefer-presence-queries"));
var prefer_screen_queries_1 = __importDefault(require("./rules/prefer-screen-queries"));
var prefer_wait_for_1 = __importDefault(require("./rules/prefer-wait-for"));
var prefer_find_by_1 = __importDefault(require("./rules/prefer-find-by"));
var rules = {
'await-async-query': await_async_query_1.default,
'await-async-utils': await_async_utils_1.default,
'await-fire-event': await_fire_event_1.default,
'consistent-data-testid': consistent_data_testid_1.default,
'no-await-sync-events': no_await_sync_events_1.default,
'no-await-sync-query': no_await_sync_query_1.default,
'no-debug': no_debug_1.default,
'no-dom-import': no_dom_import_1.default,
'no-manual-cleanup': no_manual_cleanup_1.default,
'no-render-in-setup': no_render_in_setup_1.default,
'no-wait-for-empty-callback': no_wait_for_empty_callback_1.default,
'no-wait-for-snapshot': no_wait_for_snapshot_1.default,
'prefer-explicit-assert': prefer_explicit_assert_1.default,
'prefer-find-by': prefer_find_by_1.default,
'prefer-presence-queries': prefer_presence_queries_1.default,
'prefer-screen-queries': prefer_screen_queries_1.default,
'prefer-wait-for': prefer_wait_for_1.default,
};
var recommendedRules = {
'testing-library/await-async-query': 'error',
'testing-library/await-async-utils': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/prefer-find-by': 'error',
};
module.exports = {
rules: rules,
configs: {
recommended: {
plugins: ['testing-library'],
rules: recommendedRules,
},
angular: {
plugins: ['testing-library'],
rules: __assign(__assign({}, recommendedRules), { 'testing-library/no-debug': 'warn', 'testing-library/no-dom-import': ['error', 'angular'] }),
},
react: {
plugins: ['testing-library'],
rules: __assign(__assign({}, recommendedRules), { 'testing-library/no-debug': 'warn', 'testing-library/no-dom-import': ['error', 'react'] }),
},
vue: {
plugins: ['testing-library'],
rules: __assign(__assign({}, recommendedRules), { 'testing-library/await-fire-event': 'error', 'testing-library/no-debug': 'warn', 'testing-library/no-dom-import': ['error', 'vue'] }),
},
},
};