forked from artemdemo/hostel-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
114 lines (112 loc) · 4.53 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
"extends": "airbnb",
"plugins": [],
"globals": {},
"env": {
"browser": true,
"node": true
},
"rules": {
// 4 spaces indentation
"indent": ["error", 4, { "SwitchCase": 1, "VariableDeclarator": 1 }],
// return should be without assign action,
// but it's not good in cases like the following one:
// setProperty = (newValue) => property = newValue;
"no-return-assign": 0,
// Max line lingth
"max-len": ["error", 120],
// Allowing overrriding variables.
// For example in: tests (using `done`), object destructuring
"no-shadow": 0,
// You can use "fat arrow" without parenthesis for variables:
// someArray.filter(item => item.done);
"arrow-body-style": 0,
// I use spaces whe importing variables from modules
// import { loadProjects } from './projects';
"object-curly-spacing": 0,
// No reassigning function parameters
"no-param-reassign": ["error", { "props": false }],
// Do not declare unused exprssions
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
// You can use `swith` without `default`
"default-case": 0,
// Empty string in object decalration
// There is no need in such rule
"padded-blocks": 0,
// Don't use quotes in objects properties names. only when you should use it
"quote-props": ["error", "as-needed", {
"keywords": true
}],
// Consistency in what function is returnig
"consistent-return": ["warn"],
// You can't use variables before definition.
// Functions are exception in his rule, case of hoisting
"no-use-before-define": ["error", { "functions": false }],
// In some cases "fat arrow" looks like comparison operator (>, <, <=, and >=)
// But I don't see how it's a problem
"no-confusing-arrow": 0,
// Write IIFE with parenthesis and not some wired shit
"wrap-iife": ["error", "inside"],
// Disallowing some language features:
// Do not leave command `debugger` in your code
// Do not use `with`
"no-restricted-syntax": [
"error",
"DebuggerStatement",
"WithStatement"
],
"func-names": 0,
// No space before function parenthesis
"space-before-function-paren": ["error", "never"],
// After key operators (if, else, for, etc) should be at least one space
"keyword-spacing": ["error", {"overrides": {
"catch": { "after": true }
}}],
"no-case-declarations": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
// You're not obligated to declare variables in the beginning of the function
"vars-on-top": 0,
// Use underscore to mark "private" methods
"no-underscore-dangle": 0,
// Don't use spaces before or after unary operators: !, !!, ++, --, ~
"space-unary-ops": ["error"],
// Operator should be used before new line
"operator-linebreak": ["error", "after"],
// You have 2 optionsl names for context variables: "that", "self"
"consistent-this": ["error", "that", "self"],
// Не проверяем на первую заглавную букву на свойствах объектов
// иначе использование $.Deferred(); будет считаться ошибкой
"new-cap": ["error", {
"properties": false
}],
// require can be used not oly in the beginning of the file
"global-require": 0,
// It's not required to move each chain element to new line
"newline-per-chained-call": 0,
// Only warn if there is no check for hasOwnProperty inside `for in`
"guard-for-in": ["warn"],
// Warning if there is empty block
"no-empty": ["warn"],
"no-prototype-builtins": 0,
// ********** Import **********
// Requiring of images and styles
"import/no-unresolved": 0,
// I don't prefer default export
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
"import/prefer-default-export": 0,
// You can import devDependencies, as well as dependencies, there is no problems with it
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
"import/no-extraneous-dependencies": 0,
// ********** React ************
"react/prop-types": 0,
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": 0,
"react/jsx-first-prop-new-line": 0,
"react/jsx-closing-bracket-location": 0,
"react/prefer-stateless-function": 0,
"jsx-quotes": ["error", "prefer-single"],
"react/no-did-mount-set-state": 0,
"react/jsx-pascal-case": 0,
"react/jsx-no-bind": 0
}
}