-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
103 lines (103 loc) · 2.6 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
module.exports = {
root: true,
extends: [
'@react-native',
'eslint:recommended',
'prettier',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'simple-import-sort', 'import', 'prettier'],
rules: {
'no-restricted-imports': [
2,
{
paths: [
{
importNames: ['Text'],
message: 'Use`Typography`from`@components`instead.',
name: 'react-native',
},
],
},
],
'sort-imports': 'off',
'simple-import-sort/exports': 2,
'simple-import-sort/imports': [
2,
{
groups: [
['^\\u0000'],
['^react'],
['^'],
['^@?\\w'],
[
'^@src?\\w',
'^@components?\\w',
'^@navigation?\\w',
'^@screens?\\w',
'^@themes?\\w',
'^@utils?\\w',
],
['^\\.'],
],
},
],
'import/newline-after-import': [2, { count: 1 }],
'import/no-duplicates': [2, { 'prefer-inline': true }],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0 }],
'newline-before-return': 2,
'react-native/no-color-literals': 1,
'react-native/no-inline-styles': 1,
'react-native/no-raw-text': [
2,
{
skip: [
'Layout.Header',
'Typography',
'Typography.Typography',
'Link',
'Typography.Link',
],
},
],
'react-native/no-single-element-style-arrays': 2,
'react-native/no-unused-styles': 2,
'react-native/split-platform-components': 2,
'max-len': [
'error',
{ code: 80, tabWidth: 2, ignorePattern: '^import .*|export' },
],
'no-fallthrough': 'error',
curly: [2, 'multi'],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint'],
parserOptions: {
project: './tsconfig.json',
},
parser: '@typescript-eslint/parser',
settings: {
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
'import/resolver': { typescript: { alwaysTryTypes: true } },
},
rules: {
'import/no-unresolved': 2,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'never',
},
],
},
},
],
};