-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbase.js
154 lines (154 loc) · 4.53 KB
/
base.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
module.exports = {
extends: [
'airbnb-base',
'eslint:recommended',
'plugin:comment-length/recommended',
],
ignorePatterns: [
'!/.github',
'.expo',
'**/__generated__/*',
'**/*.generated.*',
'build',
'dist',
'node_modules',
'pnpm-lock.yaml',
'Procfile',
'web-build',
'package-lock.json',
],
overrides: [
{
extends: ['./typescript'],
files: [
'*.ts', '*.js', '*.tsx', '*.jsx',
],
},
{
extends: ['./jest.js'],
files: [
'**/test/**', '**/tests/**', '**/__tests__/**', 'test/**', '**/*.test.ts', '**/*.test.tsx', '**/*.test.js', '**/*.test.jsx', '**/jest.setup.ts', '**/jest.setup.js',
],
},
{
// disable some rules for common config and script files
files: [
'scripts/*', '*.config.js', '*.config.ts', 'jest.setup.ts', 'jest.setup.js',
],
extends: ['./scripts-and-configs.js'],
},
{
extends: ['./graphql.js'],
files: ['*.graphql'],
},
{
extends: ['./yml.js'],
files: ['*.yaml', '*.yml'],
},
{
extends: ['./json.js'],
files: [
'*.json', '*.json5', '*.jsonc', '.eslintrc',
],
},
{
files: 'app.json',
rules: {
'jsonc/array-bracket-newline': 0,
},
},
],
plugins: ['import', 'functional', 'unicorn'],
rules: {
'array-element-newline': [
'error', {
ArrayExpression: 'consistent',
ArrayPattern: { minItems: 4, multiline: true },
},
],
'array-bracket-newline': ['error', { multiline: true, minItems: 4 }],
'comma-dangle': ['error', 'always-multiline'],
'function-call-argument-newline': ['error', 'consistent'],
'function-paren-newline': ['error', 'consistent'],
'functional/immutable-data': ['error', { ignoreAccessorPattern: '**.current' }],
'functional/prefer-readonly-type': 'error',
'functional/prefer-tacit': 'error',
'global-require': 0,
'import/extensions': [2, { graphql: 'always' }],
'import/no-cycle': 0,
'import/no-named-as-default-member': 0,
'import/no-named-as-default': 0,
'no-nested-ternary': 2,
'unicorn/expiring-todo-comments': [
'error',
{
allowWarningComments: false,
ignoreDatesOnPullRequests: true,
},
],
'unicorn/no-abusive-eslint-disable': 'error',
'unicorn/prefer-array-find': 'error',
'unicorn/prefer-array-index-of': 'error',
'unicorn/prefer-array-some': 'error',
'unicorn/prefer-at': 'error',
'unicorn/prefer-date-now': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-set-has': 'error',
'unicorn/prefer-ternary': 'error',
'unicorn/no-nested-ternary': 'error',
'unicorn/consistent-function-scoping': 'error',
'object-curly-newline': [
'error', {
ObjectExpression: { multiline: true, minProperties: 4, consistent: true },
ObjectPattern: { multiline: true, minProperties: 4, consistent: true },
ImportDeclaration: { multiline: true, minProperties: 4, consistent: true },
ExportDeclaration: { multiline: true, minProperties: 4, consistent: true },
},
],
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'import/order': [
'error', {
'alphabetize': { caseInsensitive: true, order: 'asc' },
'groups': [['builtin', 'external'], ['parent', 'sibling', 'index'], ['type']],
'newlines-between': 'always',
},
],
'import/prefer-default-export': 0,
'jsx-quotes': ['error', 'prefer-single'],
'linebreak-style': ['error', 'unix'],
'max-len': [
1, {
code: 200,
ignoreStrings: true,
ignoreRegExpLiterals: true,
ignoreTrailingComments: true,
ignoreComments: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
},
],
'comment-length/limit-single-line-comments': [
'warn',
{
maxLength: 120,
ignoreUrls: true,
},
],
'comment-length/limit-multi-line-comments': [
'warn',
{
maxLength: 120,
ignoreUrls: true,
},
],
'no-underscore-dangle': ['error', { allow: ['_id', '__typename'] }],
'no-unreachable': 2,
'no-use-before-define': 'off',
'no-void': ['error', { allowAsStatement: true }],
'one-var': 0,
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'quote-props': ['error', 'consistent-as-needed'],
'quotes': ['error', 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'semi': ['error', 'never'],
},
}