-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
100 lines (88 loc) · 2.47 KB
/
.eslintrc.yml
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
root: true
parser: '@typescript-eslint/parser'
parserOptions:
tsconfigRootDir: './'
project:
- './tsconfig.json'
- './packages/*/tsconfig.json'
extends:
- '@react-native-community'
- prettier
- 'plugin:@typescript-eslint/recommended'
plugins:
- import
- '@typescript-eslint'
globals:
fetch: false
__DEV__: readonly
JSX: true
env:
jest: true
rules:
# React Rules
react/prop-types: 0
react/no-unused-prop-types: 0
react/no-unused-state: 0
react/prefer-stateless-function: 2
react/forbid-prop-types: [0, { forbid: [] }]
react/require-default-props: off
react/jsx-sort-props:
- error
- callbacksLast: true
shorthandFirst: true
shorthandLast: false
ignoreCase: false
noSortAlphabetically: false
reservedFirst: true
# React-Native Rules
react-native/no-unused-styles: 2
react-native/split-platform-components: 2
react-native/no-inline-styles: 2
react-native/no-raw-text: 0
# Import Rules
import/extensions:
- 1
- never
- svg: always
json: always
import/no-extraneous-dependencies:
- error
- devDependencies: true
optionalDependencies: false
peerDependencies: false
import/prefer-default-export: off
implicit-arrow-linebreak: off
# General Rules
semi:
- error
- never
comma-dangle: off
no-unused-vars: off
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: '^_'
varsIgnorePattern: '^_'
operator-linebreak:
- error
- before
- overrides:
'=': ignore
no-console: 2
no-plusplus: off
no-nested-ternary: off
arrow-body-style: off
consistent-return: off
curly:
- error
- all
# for post defining style object in react-native
no-use-before-define: off
'@typescript-eslint/no-use-before-define':
- error
- variables: false
functions: false
# Unnecessary ts-eslint rules for a primarily storybook repo
'@typescript-eslint/no-empty-function': off # This rule is nice, but it is not worth the annoyance when mocking story functions that you do not want to use actions for.
'@typescript-eslint/no-var-requires': off # This rule is just a pain
'@typescript-eslint/no-explicit-any': off # This rule is nice, but not for a repo with so many storybook types that aren't beneficial to type (aka StoryFn)
'@typescript-eslint/explicit-module-boundary-types': off # This rule is nice, but not for a repo with so many stories that do not benefit from having an explicit return type