-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
117 lines (117 loc) · 2.94 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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
'airbnb/hooks',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:eslint-comments/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
ignorePatterns: ['api/*', '.eslintrc.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: [
'import',
'react',
'@typescript-eslint',
'react-native',
'eslint-comments',
'eslint-plugin-newline-destructuring',
],
rules: {
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: ['function-expression', 'arrow-function'],
},
],
'import/extensions': ['error', 'never'],
'import/no-unresolved': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'react/jsx-filename-extension': [
2,
{
extensions: ['.jsx', '.tsx'],
},
],
'@typescript-eslint/no-unused-vars': ['error', 'all'],
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'eslint-comments/disable-enable-pair': [
'error',
{
allowWholeFile: true,
},
],
'eslint-comments/no-unused-disable': 'warn',
'jest/valid-title': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
alphabetize: {
order: 'ignore',
caseInsensitive: false,
},
},
],
'newline-destructuring/newline': [
'error',
{
items: 2,
},
],
'operator-linebreak': [
'error',
'after',
{
overrides: {
'=': 'none',
},
},
],
'no-multi-spaces': 'error',
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'comma-dangle': ['error', 'always-multiline'],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
// use <root>/path/to/folder/tsconfig.json
project: '<root>/tsconfig.json',
},
},
},
};