-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.yaml
128 lines (117 loc) · 3.29 KB
/
.eslintrc.yaml
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
---
root: true
parser: '@typescript-eslint/parser'
parserOptions:
project: './tsconfig.json'
plugins:
- '@typescript-eslint/eslint-plugin'
- 'eslint-plugin-babel'
- 'eslint-plugin-jsx-expressions'
- 'eslint-plugin-react'
- 'eslint-plugin-react-native'
- 'eslint-plugin-react-hooks'
- '@tanstack/eslint-plugin-query'
extends:
- '@react-native'
- 'eslint:recommended'
- 'plugin:react/recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@tanstack/eslint-plugin-query/recommended'
- 'prettier'
settings:
react:
version: '16.6'
env:
es6: true
react-native/react-native: true
rules:
array-callback-return: error
camelcase: warn
consistent-this: [error, self]
curly: [warn, multi-line]
default-case: error
guard-for-in: error
eqeqeq: [error, smart]
linebreak-style: [error, unix]
new-cap: off
no-await-in-loop: warn
no-case-declarations: error
no-console: off
no-div-regex: error
no-extra-label: error
no-implicit-coercion:
- error
- boolean: true
number: true
string: true
no-implicit-globals: error
no-multi-assign: error
no-new-symbol: error
no-restricted-syntax: [error, WithStatement]
no-return-await: error
no-throw-literal: error
no-undef-init: off
no-underscore-dangle: off
no-unmodified-loop-condition: error
no-unused-vars: off
'@typescript-eslint/no-unused-vars':
- warn
- args: 'after-used'
argsIgnorePattern: '^_'
varsIgnorePattern: '^_'
no-useless-constructor: error
no-var: error
prefer-const: off
prefer-promise-reject-errors: error
prefer-spread: error
quotes: [warn, single, avoid-escape]
require-await: warn
semi: off
no-misleading-character-class: warn
require-atomic-updates: error
no-async-promise-executor: error
require-unicode-regexp: error
# react rules – https://github.com/yannickcr/eslint-plugin-react
react/display-name: off
react/jsx-curly-brace-presence: [warn, never]
react/jsx-key: warn
react/jsx-no-bind:
- warn
- ignoreRefs: true
allowArrowFunctions: true
react/jsx-sort-props:
- warn
- reservedFirst: true
ignoreCase: false
react/no-access-state-in-setstate: error
react/no-did-mount-set-state: error
react/no-did-update-set-state: error
react/no-multi-comp: off # prevent multiple component definition per file
react/no-redundant-should-component-update: warn
react/no-typos: error
react/prop-types: off
react/self-closing-comp: warn # prevent extra closing tags for components without children
react/sort-comp:
- warn
- order:
- static-variables
- static-methods
- type-annotations
- lifecycle
- everything-else
- render
react/sort-prop-types: warn
react/wrap-multilines: off
react/jsx-boolean-value: [error, always]
# react-native rules
react-native/no-unused-styles: warn
react-native/no-inline-styles: warn
react-native/no-color-literals: warn
# react hooks rules
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: warn
# TODO(rye): Follow-up: DENY these
'@typescript-eslint/explicit-module-boundary-types': warn
'@typescript-eslint/no-empty-function': warn
# eslint-plugin-jsx-expressions – https://github.com/hpersson/eslint-plugin-jsx-expressions/
jsx-expressions/strict-logical-expressions: warn