forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
97 lines (87 loc) · 2.93 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
parser: babel-eslint
plugins:
- react-native
- jest
- flowtype
env:
browser: true
mocha: true
node: true
jest: true
globals: # true/false means mutable/const
__DEV__: false
__TEST__: false
extends:
- airbnb
- plugin:jest/recommended
- ./tools/formatting.eslintrc.yaml
settings:
import/resolver:
node:
extensions: [.js, .ios.js, .android.js, .json]
rules:
# Formatting and naming
camelcase: off
# Disable a bunch of rules that should be taken care of by prettier.
arrow-parens: off
comma-dangle: off
function-paren-newline: off
indent: off
max-len: off
no-mixed-operators: off
object-curly-newline: off
quote-props: off
# For more formatting rules, see tools/formatting.eslintrc.yaml.
# Tricky code. We repeal several bans from the Airbnb style.
no-bitwise: off
no-confusing-arrow: off
no-continue: off
no-plusplus: off
no-nested-ternary: off
# Likely-wrong code
no-unused-vars: [warn, {vars: local, args: none}]
# no-param-reassign seems well-intentioned... but fires on common uses
# of Array#reduce. Too noisy.
no-param-reassign: off
# Imports
import/prefer-default-export: off
import/no-extraneous-dependencies:
- error
- devDependencies: ['**/__tests__/*.js', tools/**]
# Jest
# This rule could be useful if it fired only on new instances; but we
# don't have a way to do that, and it doesn't make sense to keep these
# out of the repo.
jest/no-disabled-tests: off
# React
react/jsx-filename-extension: off # Like RN upstream, we call the files *.js.
react/require-default-props: off # We handle this better with types.
# These two could be good to fix.
react/prefer-stateless-function: off
react/sort-comp: off
# React Native. This plugin isn't included in the airbnb config, and
# nothing is enabled by default, so we enable its rules.
react-native/no-unused-styles: error
react-native/no-inline-styles: error
# react-native/no-color-literals: error # TODO eliminate these and enable.
# Flow
flowtype/boolean-style: [error, boolean]
flowtype/define-flow-type: warn
flowtype/delimiter-dangle: off
flowtype/generic-spacing: [error, never]
flowtype/no-primitive-constructor-types: error
flowtype/no-types-missing-file-annotation: error
################# flowtype/no-weak-types: error
flowtype/object-type-delimiter: [error, comma]
# flowtype/require-parameter-type: error
# flowtype/require-return-type: [error, always, {annotateUndefined: never}]
flowtype/require-valid-file-annotation: error
flowtype/semi: [error, always]
flowtype/space-before-generic-bracket: [error, never]
flowtype/space-before-type-colon: [error, never]
# For more formatting rules, see tools/formatting.eslintrc.yaml.
flowtype/type-id-match: [error, '^([A-Z][a-z0-9]+)+$']
flowtype/union-intersection-spacing: [error, always]
flowtype/use-flow-type: warn
flowtype/valid-syntax: warn
# spellcheck/spell-checker: see tools/spellcheck.eslintrc.yaml .