forked from Agontuk/schema-designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
96 lines (72 loc) · 2.89 KB
/
.eslintrc
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
{
extends: [
'airbnb',
'plugin:flowtype/recommended'
],
parser: 'babel-eslint',
plugins: [
'react',
'flowtype'
],
rules: {
# Auto detect arrow body style
arrow-body-style: ['error', 'as-needed'],
# Always use parentheses around arrow function
arrow-parens: ['error', 'always'],
# Disable trailing comma
comma-dangle: ['error', 'never'],
# Use indent with 4 spaces
indent: ['error', 4, {VariableDeclarator: {var: 2, let: 2, const: 2}, SwitchCase: 1}],
# Use single quote in jsx attributes
jsx-quotes: ['error', 'prefer-single'],
# Allow max line length of 120
max-len: ['error', 120],
# Enforce spaces inside template literals
template-curly-spacing: ['error', 'always'],
# Allow interaction handlers on non-semantic elements
jsx-a11y/no-static-element-interactions: 'off',
# Use space inside curly brace
react/jsx-curly-spacing: ['error', 'always'],
# Use indent with 4 spaces for jsx
react/jsx-indent: ['error', 4],
# Use indent with 4 spaces in props
react/jsx-indent-props: ['error', 4],
# Allow .js & .jsx extension
react/jsx-filename-extension: ['error', { 'extensions': ['.js', '.jsx'] }],
# Detect missing key prop
react/jsx-key: 'error',
# Enforce component methods order
react/sort-comp: 'off',
# Prevent self closing tags for html component
react/self-closing-comp: ['error', { 'component': true, 'html': false }],
# Enforces consistent use of trailing commas in Object and Tuple annotations.
flowtype/delimiter-dangle: ['error', 'never'],
# Checks for duplicate properties in Object annotations.
flowtype/no-dupe-keys: 'error',
# Disallows use of primitive constructors as types (e.g. Boolean)
flowtype/no-primitive-constructor-types: 'error',
# Warns against weak type annotations (any, Object and Function).
flowtype/no-weak-types: ['error', { 'any': false }],
# Enforces consistent separators between properties in Flow object types.
flowtype/object-type-delimiter: ['error', 'comma'],
# Requires that all function parameters have type annotations.
flowtype/require-parameter-type: ['error', { 'excludeArrowFunctions': true }],
# Requires that functions have return type annotation.
flowtype/require-return-type: ['error', { 'excludeArrowFunctions': true }],
# Enforces consistent use of semicolons after type aliases.
flowtype/semi: ['error', 'always']
},
env: {
es6: true,
browser: true,
node: true,
jest: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
}