-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path.eslintrc.js
106 lines (105 loc) · 2.58 KB
/
.eslintrc.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
module.exports = {
root: true,
parserOptions: {
project: ['tsconfig.json', 'tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
env: {
node: true,
browser: true,
jasmine: true,
},
globals: {
_: false,
cy: false,
inject: false,
angular: false,
Cypress: false,
Promise: false,
},
extends: ['plugin:@bitrise/config'],
plugins: ['jasmine'],
rules: {
/** * Import related rules ** */
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.stories.tsx',
'**/*.spec.{ts,tsx}',
'**/*.mocks.ts',
'**/*.mswMocks.ts',
'**/*.utils.ts',
'**/*.factory.ts',
'*rc.js',
'*.config.{js,ts}',
],
},
],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'jsx-a11y/anchor-is-valid': 'warn',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-types': ['warn', { types: { '{}': false }, extendDefaults: true }],
'react/no-unescaped-entities': ['error', { forbid: ['>', '"', '}'] }],
'testing-library/await-async-queries': 'off',
'no-restricted-globals': [
'error',
{
name: 'TEST_BITRISE_YML',
message: 'Do not use TEST_BITRISE_YML outside of storybook, spec or mock files.',
},
],
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
{
files: ['*.stories.*'],
rules: {
'react-hooks/rules-of-hooks': 'warn',
},
},
{
files: ['*.spec.{ts,tsx}'],
rules: {
'testing-library/await-async-queries': 'error',
},
},
{
files: ['*.spec.{ts,tsx}', '*.stories.tsx', '*.mocks.ts', '*.mswMocks.ts'],
rules: {
'no-restricted-globals': 'off',
},
},
{
files: ['*.spec.{ts,tsx}', '*.stories.tsx', '*.mocks.ts', '*.mswMocks.ts', '*.factory.ts', '*.utils.ts'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
files: ['./tests/*.spec.ts'],
rules: {
'testing-library/prefer-screen-queries': 'off',
},
},
],
settings: {
'import/resolver': {
alias: {
map: [['@', './source/javascripts']],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};