-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.backtrackrc.js
117 lines (103 loc) · 2.31 KB
/
.backtrackrc.js
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
'use strict';
/** @type {import('@backtrack/core').Config} */
const config = {
presets: [
[
'@backtrack/node',
{ mode: 'module', syntax: 'typescript' },
],
],
packageJson: {
files: [
'dist/',
'paths.js',
],
},
config: {
babel: (config) => {
const presetEnvConfig = config.presets.find((preset) => {
if (Array.isArray(preset) === false) {
return false;
}
return preset[0].includes('@babel/preset-env');
});
presetEnvConfig[1].useBuiltIns = 'usage';
presetEnvConfig[1].corejs = 3;
return config;
},
eslint: {
rules: {
'jest/prefer-inline-snapshots': 'off',
},
overrides: [
{
files: ['./paths.js'],
rules: {
'import/no-unresolved': 'off',
'import/extensions': 'off',
},
},
{
files: [
'*.{ts,tsx}',
'.*.{ts,tsx}',
],
rules: {
'no-await-in-loop': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/strict-boolean-expressions': [
'off',
// {
// allowNullable: true,
// allowSafe: true,
// ignoreRhs: true,
// },
],
'jest/no-export': 'off',
'@typescript-eslint/explicit-module-boundary-types': [
'error',
],
'@typescript-eslint/explicit-function-return-type': [
'error',
],
'@typescript-eslint/no-unnecessary-condition': 'off',
},
},
{
files: [
'*.test.{ts,tsx}',
],
rules: {
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-confusing-void-expression':
'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type':
'off',
},
},
],
},
wallaby: (config) => {
config.files = config.files.filter((pattern) => {
return pattern !== '!**/node_modules/**';
});
config.files.push('!node_modules/**');
return config;
},
/**
* Jest v29 does not support prettier v3.
*
* Remove this when Jest v30 is released.
*
* https://jestjs.io/docs/configuration/#prettierpath-string
*/
jest: {
prettierPath: null,
},
},
};
module.exports = config;