forked from divio/aldryn-forms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
40 lines (38 loc) · 2.48 KB
/
.eslintrc.js
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
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
// Basic settings
"indent": ["warn", 4, { "SwitchCase": 1 }], // Indent with 4 spaces; indent case in switch;
"no-tabs": ["warn"], // Don't use tabs
"no-trailing-spaces": ["warn"], // Don't allow trailing spaces
"linebreak-style": ["error", "unix"], // End lines with UNIX line breaks
"max-len": ["warn", { "code": 120 }], // Line length is limited by 120 characters
"semi": ["error", "never"], // Don't use semicolons if not necessary
"semi-style": ["error", "first"], // If necessary, write semicolon at the beginning of the line
"no-console": ["warn"], // Allow console in the code.
// Code settings
"no-use-before-define": ["error"], // Define functions, classes and variables before you use them
"no-var": ["warn"], // Don't allow var
"prefer-const": ["warn", { "ignoreReadBeforeAssign": true }], // If let is not assigned to, prefer const
"no-return-assign": ["error", "always"], // Don't allow assingment in return statement
"eqeqeq": ["error", "smart"], // Reqire use of === and !== instead of == and != (with a few exceptions)
"complexity": ["warn", 50], // Maximum cyclomatic complexity
// Spacing settings
"keyword-spacing": ["warn"], // Reqiure spacing around keywords
"func-call-spacing": ["error", "never"], // Don't allow spaces between function call and arguments
"space-before-function-paren": ["error", "never"], // Don't allow spaces before function definition parenthesis
"spaced-comment": ["warn", "always"], // Require whitespace after //
"space-in-parens": ["warn", "never"], // Don't allow spaces in parenthesis
"comma-spacing": ["warn"], // Reqire space after comma, don't allow space before
"space-infix-ops": ["warn"], // Require spaces around infix operators (including =)
}
};