forked from web-scrobbler/web-scrobbler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
134 lines (129 loc) · 4.27 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
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
'use strict';
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true,
'mocha': true
},
'extends': 'eslint:recommended',
'globals': {
'$': true,
'chrome': true,
'Require': true,
'define': true
},
'rules': {
/**
* Possible errors
*/
// Enforce “for” loop update clause moving the counter
// in the right direction
'for-direction': 'error',
// Allow the use of console
'no-console': 'off',
// Disallow template literal placeholder syntax in regular string
'no-template-curly-in-string': 'error',
// Enforce valid JSDoc comments
'valid-jsdoc': ['error', {
'prefer': {
'arg': 'param', 'argument': 'param', 'returns': 'return',
},
'requireReturn': false
}],
/**
* Best practices
*/
// Enforce consistent brace style for all control statements
'curly': 'error',
// Require the use of === and !==
'eqeqeq': 'error',
// Disallow `else` blocks after `return` statements in `if` statements
'no-else-return': 'error',
// Disallow empty functions
'no-empty-function': 'error',
// Disallow function declarations and expressions inside loop statements
'no-loop-func': 'error',
// Disallow new operators with the String, Number, and Boolean objects
'no-new-wrappers': 'error',
// Disallow unnecessary concatenation of strings
'no-useless-concat': 'error',
// Disallow redundant return statements
'no-useless-return': 'error',
/**
* Strict mode
*/
// Require global strict mode directive
'strict': ['error', 'global'],
/**
* Stylistic Issues
*/
// Require 'one true brace style', in which the opening brace
// of a block is placed on the same line as its corresponding
// statement or declaration
'brace-style': ['error', '1tbs'],
// Disallow spaces inside of brackets
'array-bracket-spacing': ['error', 'never'],
// Require space after comma
'comma-spacing': ['error', { 'after': true }],
// Require or Disallow newline at the end of files
'eol-last': ['error', 'always'],
// Disallow spacing between function identifiers and their invocations
'func-call-spacing': 'error',
// use tabs as indentation
'indent': ['error', 'tab', {
// enforces indentation level for case clauses in switch statements
'SwitchCase': 1,
}],
// Require space after colon in object literal properties
'key-spacing': ['error', { 'afterColon': true }],
// Require space before and after keywords
'keyword-spacing': ['error'],
// Require Unix line endings
'linebreak-style': ['error', 'unix'],
// Disallow empty block statements
'no-empty': ['error', { 'allowEmptyCatch': true }],
// Disallow `if` statements as the only statement in `else` blocks
'no-lonely-if': 'error',
// Disallow multiple spaces
'no-multi-spaces': 'error',
// Disallow nested ternary expressions
'no-nested-ternary': 'error',
// Disallow trailing whitespace at the end of lines
'no-trailing-spaces': 'error',
// Disallow ternary operators when simpler alternatives exist
'no-unneeded-ternary': 'error',
// Disallow whitespace before properties
'no-whitespace-before-property': 'error',
// Require spaces inside curly braces
'object-curly-spacing': ['error', 'always'],
// Require single quotes
'quotes': ['error', 'single'],
// Require space before blocks
'space-before-blocks': ['error', 'always'],
// Disallow a space before function parenthesis
'space-before-function-paren': ['error', 'never'],
// Disallow spaces inside of parentheses
'space-in-parens': 'error',
// Require spacing around infix operators
'space-infix-ops': 'error',
// Enforce consistent spacing after the // or /* in a comment
'spaced-comment': 'error',
// Require semicolon at the end of statement
'semi': ['error', 'always'],
// Enforce spacing around colons of switch statements
'switch-colon-spacing': ['error', { 'after': true, 'before': false }],
/**
* ECMAScript 6
*/
// Require parentheses around arrow function arguments
'arrow-parens': 'error',
'arrow-spacing': 'error',
// Require method and property shorthand syntax for object literals
'object-shorthand': ['error', 'always'],
// Require template literals instead of string concatenation
'prefer-template': 'error',
// Disallow spacing around embedded expressions of template strings
'template-curly-spacing': 'error',
}
};