-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.yaml
152 lines (148 loc) · 6.2 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
root: true
env:
node: true
browser: true
es2021: true
jest: true
parser: '@typescript-eslint/parser'
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 12
sourceType: module
plugins:
- '@typescript-eslint'
- eslint-plugin-import
- eslint-plugin-react
- eslint-plugin-react-hooks
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:import/recommended
- plugin:react/recommended
- plugin:react-hooks/recommended
settings:
react:
version: detect
import/resolver:
node: {
paths: ['.'],
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
typescript: { project: './tsconfig.json' }
import/extensions: ['.js', '.jsx', '.ts', '.tsx']
rules:
semi: [error, never]
quotes: [error, single]
no-console: [error, { allow: [warn, error, log, info] }]
object-curly-spacing: 0
# Import rules
# import/order: [error, { alphabetize: { order: asc } }]
import/named: [off]
import/namespace: [off]
# Typescript rules
'@typescript-eslint/object-curly-spacing': [error, always]
'@typescript-eslint/consistent-type-imports': [error, { prefer: type-imports }]
'@typescript-eslint/no-explicit-any': [off]
# React rules
react/boolean-prop-naming: [error, { rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+' }]
# react/button-has-type: [error, { button: true, submit: true, reset: true }]
# react/default-props-match-prop-types: [error, { allowRequiredDefaults: true }]
react/destructuring-assignment: [error, always]
# react/display-name: [error, { ignoreTranspilerName: false }]
react/forbid-component-props: [error, { forbid: [children] }]
# react/forbid-dom-props: [error, { forbid: [style] }]
# react/forbid-elements: [error, { forbid: [button] }]
# react/forbid-foreign-prop-types: [error, { allowInPropTypes: true }]
# react/forbid-prop-types: [error, { forbid: [any, array, bool, func, number, object, string, symbol] }]
react/function-component-definition: [error, { namedComponents: function-declaration, unnamedComponents: arrow-function }]
react/hook-use-state: [error, { allowDestructuredState: true }]
react/iframe-missing-sandbox: [error]
react/jsx-boolean-value: [error, never]
# react/jsx-child-element-spacing: [error, never]
react/jsx-closing-bracket-location: [error, line-aligned]
react/jsx-closing-tag-location: [error]
# react/jsx-curly-brace-presence: [error, { props: 'never', children: 'never' }]
react/jsx-curly-newline: [error]
react/jsx-curly-spacing: [error, always]
react/jsx-equals-spacing: [error, never]
react/jsx-filename-extension: [error, { extensions: ['.jsx', '.tsx'] }]
react/jsx-first-prop-new-line: [error, multiline]
react/jsx-fragments: [error, syntax]
react/jsx-handler-names: [off, { eventHandlerPrefix: on, checkLocalVariables: true, checkInlineFunction: true }]
react/jsx-indent-props: [error, 2]
react/jsx-indent: [error, 2]
react/jsx-key: [error, { checkFragmentShorthand: true }]
react/jsx-max-depth: [error, { max: 7 }]
react/jsx-max-props-per-line: [error, { maximum: { single: 3, multi: 1 } }]
react/jsx-newline: [error]
react/jsx-no-bind: [error, { allowArrowFunctions: true }]
react/jsx-no-comment-textnodes: [error]
react/jsx-no-constructed-context-values: [error]
react/jsx-no-duplicate-props: [error]
react/jsx-no-leaked-render: [error]
# react/jsx-no-literals: [error]
# react/jsx-no-script-url: [error]
# react/jsx-no-target-blank: [error]
react/jsx-no-undef: [error]
react/jsx-no-useless-fragment: [error]
react/jsx-one-expression-per-line: [error, { allow: single-child }]
react/jsx-pascal-case: [error, { allowAllCaps: true, ignore: [] }]
react/jsx-props-no-multi-spaces: [error]
# react/jsx-props-no-spreading: [error, { html: true }]
react/jsx-sort-props: [error, { shorthandFirst: true }]
react/jsx-tag-spacing: [error, { closingSlash: never, beforeSelfClosing: always, afterOpening: never, beforeClosing: never }]
react/jsx-uses-react: [error]
react/jsx-uses-vars: [error]
# react/jsx-wrap-multilines: [error, { declaration: parens-new-line, assignment: parens-new-line, arrow: parens }]
# react/no-access-state-in-setstate: [error]
# react/no-adjacent-inline-elements: [error]
react/no-array-index-key: [error]
react/no-arrow-function-lifecycle: [error]
react/no-children-prop: [error]
# react/no-danger-with-children: [error]
# react/no-danger: [error]
react/no-deprecated: [error]
react/no-did-mount-set-state: [error]
react/no-did-update-set-state: [error]
react/no-direct-mutation-state: [error]
react/no-find-dom-node: [error]
# react/no-invalid-html-attribute: [error]
react/no-is-mounted: [error]
react/no-multi-comp: [error]
react/no-namespace: [error]
# react/no-object-type-as-default-prop: [error]
react/no-redundant-should-component-update: [error]
react/no-render-return-value: [error]
# react/no-set-state: [error]
react/no-string-refs: [error, { noTemplateLiterals: true }]
react/no-this-in-sfc: [error]
react/no-typos: [error]
react/no-unescaped-entities: [error]
react/no-unknown-property: [error, { ignore: [] }]
# react/no-unsafe: [error]
react/no-unstable-nested-components: [error, { allowAsProps: false }]
react/no-unused-class-component-methods: [error]
react/no-unused-prop-types: [error, { customValidators: [], skipShapeProps: true, ignore: [] } ]
react/no-unused-state: [error]
react/no-will-update-set-state: [error]
react/prefer-es6-class: [error, always]
# react/prefer-exact-props: [error, { ignoreShapeProps: true, ignore: [] }]
# react/prefer-read-only-props: [error]
react/prefer-stateless-function: [error]
react/prop-types: [error, { ignore: [], customValidators: [] }]
react/react-in-jsx-scope: [error]
# react/require-default-props: [error]
react/require-optimization: [error]
react/require-render-return: [error]
react/self-closing-comp: [error]
react/sort-comp: [error, { order: ['static-methods', 'lifecycle', 'everything-else', 'render'] }]
react/sort-default-props: [error]
react/sort-prop-types: [error]
react/state-in-constructor: [error, always]
react/static-property-placement: [error]
react/style-prop-object: [error]
react/void-dom-elements-no-children: [error]
# React hooks
react-hooks/exhaustive-deps: [off]
react-hooks/rules-of-hooks: [off]