-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.js
137 lines (137 loc) · 2.99 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
module.exports = {
extends: [
'eslint-config-airbnb',
'plugin:prettier/recommended',
'prettier/react',
],
overrides: [
{
files: ['*.tsx', '*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
},
},
{
files: ['*.jsx', '**/*.js'],
parser: 'babel-eslint',
extends: ['plugin:flowtype/recommended', 'prettier/flowtype'],
},
{
files: [
'*.test.js',
'*.test.jsx',
'*.test.ts',
'*.test.tsx',
'**/__tests__/**',
'**/__test-helpers__/**',
'**/tests/**',
],
extends: ['plugin:jest/recommended'],
env: {
'jest/globals': true,
},
},
{
files: ['packages/integration-tests/__tests__/integration/browser/**'],
env: {
browser: true,
},
},
{
files: ['packages/rudy/**'],
rules: {
'no-param-reassign': 0,
},
},
{
files: ['packages/react/**'],
rules: {
'no-param-reassign': 0,
},
env: {
browser: true,
},
},
{
files: ['packages/boilerplate/**'],
env: {
'shared-node-browser': true,
},
settings: {
'import/resolver': {
node: {
extensions: [
'.browser.js',
'.server.js',
'.ts',
'.tsx',
'.js',
'.jsx',
'.css',
],
},
},
},
rules: {
'react/jsx-filename-extension': 0,
'react/prop-types': ['error', { skipUndeclared: true }],
},
},
],
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
webpack: {
config: {
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
mainFields: ['rudy-src-main'],
},
},
},
},
'import/extensions': ['.ts', '.tsx', '.js', '.jsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
'babel-eslint': ['.js', '.jsx'],
},
},
rules: {
'prettier/prettier': 'warn',
'no-use-before-define': [
'error',
{ functions: false, classes: false, variables: false },
],
'no-underscore-dangle': 0,
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-nested-ternary': 0,
'import/no-extraneous-dependencies': [
2,
{
devDependencies: ['config/**', 'lint-staged.config.js'],
},
],
'import/no-unresolved': [
'error',
{
ignore: ['./buildClient/stats.json$', './buildServer/h$'],
},
],
},
}