-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
121 lines (121 loc) · 3.17 KB
/
index.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
module.exports = {
extends: [
'airbnb',
'airbnb/hooks'
],
plugins: [
'react',
'@typescript-eslint',
'unused-imports',
"no-relative-import-paths",
"import"
],
env: {
browser: true,
es2021: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 13,
sourceType: 'module',
},
rules: {
/**
* Basic linting
*/
'max-len': ['error', 150, { ignoreComments: true }],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'consistent-return': 'off',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
indent: ['error', 2, { SwitchCase: 1 }],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
}],
'eol-last': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'object-curly-newline': ['error', {
ImportDeclaration: 'never',
ObjectPattern: {
multiline: true,
minProperties: 5,
},
ExportDeclaration: {
multiline: true,
minProperties: 5,
},
}],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never", "asyncArrow": "always"}],
'no-multi-spaces': ['error'],
'no-param-reassign': 'off',
'no-trailing-spaces': ['error'],
'no-multiple-empty-lines': ['error', { max: 1 }],
/**
* Imports
*/
'unused-imports/no-unused-imports': 'warn',
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{ "allowSameFolder": false, "rootDir": "src" }
],
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
ts: 'never',
tsx: 'never',
},
],
"import/order": ["error", {
"newlines-between": "never",
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
}],
/**
* React and JSX
*/
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/no-array-index-key': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-props-no-spreading': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'react/jsx-curly-brace-presence': ['warn', {
props: 'always',
children: 'never',
}],
'react/jsx-max-props-per-line': ['error', { maximum: 1 }],
'react/jsx-boolean-value': ['error', 'never'],
'react/jsx-closing-bracket-location': ['error'],
'react/jsx-closing-tag-location': ['error'],
'react/jsx-sort-props': ['warn', {
callbacksLast: true,
shorthandLast: true,
noSortAlphabetically: true,
reservedFirst: true,
}],
'react/function-component-definition': ['error', {
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
}],
},
}