@@ -18,37 +18,37 @@ module.exports = {
18
18
// This rule enforces consistent use of trailing commas in object and array literals
19
19
// Allow trailing commas for func parameters, array and object literals spread across
20
20
// multiple lines
21
- 'comma-dangle' : [ 1 , 'always-multiline' ] ,
21
+ 'comma-dangle' : [ 'warn' , 'always-multiline' ] ,
22
22
23
23
// Require Camelcase
24
24
// This rule looks for any underscores (_) located within the source code. It ignores leading
25
25
// and trailing underscores and only checks those in the middle of a variable name. If ESLint
26
26
// decides that the variable is a constant (all uppercase), then no warning will be thrown.
27
- camelcase : [ 1 , {
27
+ camelcase : [ 'warn' , {
28
28
properties : 'always' ,
29
29
} ] ,
30
30
31
31
// Require Consistent This
32
32
// This rule designates a variable as the chosen alias for `this`.
33
- 'consistent-this' : [ 1 , 'self' ] ,
33
+ 'consistent-this' : [ 'warn' , 'self' ] ,
34
34
35
35
// Enforce Function Style
36
36
// Due to these different behaviors, it is common to have guidelines as to which style of
37
37
// function should be used. There is really no correct or incorrect choice here, it is just a
38
38
// preference. A good reason to use function declarations is that the function names then appear
39
39
// in stack traces which help during debugging.
40
40
// Allow arrow functions to be saved into variables
41
- 'func-style' : [ 1 , 'declaration' , {
41
+ 'func-style' : [ 'warn' , 'declaration' , {
42
42
allowArrowFunctions : true ,
43
43
} ] ,
44
44
45
45
// Require function names to match the name of the variable to which they are assigned
46
- 'func-name-matching' : 1 ,
46
+ 'func-name-matching' : 'warn' ,
47
47
48
48
// Limit minimum and maximum length for identifiers
49
49
// This rule is aimed at increasing code readability and maintainability by enforcing an
50
50
// identifier length convention.
51
- 'id-length' : [ 1 , {
51
+ 'id-length' : [ 'warn' , {
52
52
min : 2 ,
53
53
max : 25 ,
54
54
exceptions : [
@@ -61,95 +61,95 @@ module.exports = {
61
61
// Very long lines of code in any language can be difficult to read. In order to aid in
62
62
// readability and maintainability many coders have developed a convention to limit lines of
63
63
// code to a certain number of characters.
64
- 'max-len' : [ 1 , 100 , 2 ] ,
64
+ 'max-len' : [ 'warn' , 100 , 2 ] ,
65
65
66
66
// Limit Maximum Number of Parameters
67
67
// Functions that take numerous parameters can be difficult to read and write because it
68
68
// requires the memorization of what each parameter is, its type, and the order they should
69
69
// appear in.
70
- 'max-params' : [ 1 , 4 ] ,
70
+ 'max-params' : [ 'warn' , 4 ] ,
71
71
72
72
// Set Maximum Depth of Nested Callbacks
73
73
// This rule is aimed at increasing code clarity by discouraging deeply nesting callbacks.
74
- 'max-nested-callbacks' : [ 1 , 4 ] ,
74
+ 'max-nested-callbacks' : [ 'warn' , 4 ] ,
75
75
76
76
// Specify the Maximum Number of Statements Allowed per Line
77
77
// A line of code containing too many statements can be difficult to read. Code is generally
78
78
// read from the top down, especially when scanning, so limiting the number of statements
79
79
// allowed on a single line can be very beneficial for readability and maintainability.
80
- 'max-statements-per-line' : 1 ,
80
+ 'max-statements-per-line' : 'warn' ,
81
81
82
82
// Require Constructors to Use Initial Caps
83
83
// This rule is aimed at helping to distinguish regular functions from constructor functions. As
84
84
// such, it warns whenever it sees new followed by an identifier that isn't capitalized or
85
85
// whenever it sees capitalized function called directly without new operator.
86
- 'new-cap' : [ 1 , {
86
+ 'new-cap' : [ 'warn' , {
87
87
newIsCap : true ,
88
88
capIsNew : true ,
89
89
} ] ,
90
90
91
91
// Newline Per Chained Method Call
92
92
// This rule checks and reports the chained calls if there are no new lines after each call or
93
93
// deep member access.
94
- 'newline-per-chained-call' : [ 1 , {
94
+ 'newline-per-chained-call' : [ 'warn' , {
95
95
ignoreChainWithDepth : 3 ,
96
96
} ] ,
97
97
98
98
// Disallow duplicate exports/imports
99
99
// An ES6/ES2015 import can be spread over multiple lines, but this takes up unneeded
100
100
// whitespace. This rules validates that all imports from a single module exists in a single
101
101
// import statement.
102
- 'no-duplicate-imports' : [ 1 , {
102
+ 'no-duplicate-imports' : [ 'warn' , {
103
103
includeExports : true ,
104
104
} ] ,
105
105
106
106
// Disallows comments after code
107
107
// This rule will disallow comments on the same line as code.
108
- 'no-inline-comments' : 1 ,
108
+ 'no-inline-comments' : 'warn' ,
109
109
110
110
// Disallow mixes of different operators
111
111
// Enclosing complex expressions by parentheses clarifies the developer’s intention, which makes
112
112
// the code more readable. This rule warns when different operators are used consecutively
113
113
// without parentheses in an expression.
114
- 'no-mixed-operators' : 1 ,
114
+ 'no-mixed-operators' : 'warn' ,
115
115
116
116
// Disallow mixed spaces and tabs for indentation
117
117
// The no-mixed-spaces-and-tabs rule is aimed at flagging any lines of code that are indented
118
118
// with a mixture of tabs and spaces.
119
- 'no-mixed-spaces-and-tabs' : 1 ,
119
+ 'no-mixed-spaces-and-tabs' : 'warn' ,
120
120
121
121
// Disallow tabs
122
122
// Use of tabs is discouraged in favour of spaces because there is no "standard" width for a tab
123
123
// character and many viewers/editors use their own tab width, which could cause code to be
124
124
// misaligned and not formatted as intended/indented.
125
- 'no-tabs' : 1 ,
125
+ 'no-tabs' : 'warn' ,
126
126
127
127
// Disallow Nested Ternaries
128
128
// The no-nested-ternary rule aims to increase the clarity and readability of code by
129
129
// disallowing the use of nested ternary expressions.
130
- 'no-nested-ternary' : 2 ,
130
+ 'no-nested-ternary' : 'error' ,
131
131
132
132
// Disallow Dangling Underscores in Identifiers
133
- 'no-underscore-dangle' : 1 ,
133
+ 'no-underscore-dangle' : 'warn' ,
134
134
135
135
// Disallow Warning Comments
136
136
// These comments are a warning signal, that there is something not production ready in your
137
137
// code. Most likely you want to fix it or remove the comments before you roll out your code
138
138
// with a good feeling.
139
- 'no-warning-comments' : [ 1 , {
139
+ 'no-warning-comments' : [ 'warn' , {
140
140
location : 'anywhere' ,
141
141
} ] ,
142
142
143
143
// Require or Disallow One Variable Declaration per Scope
144
144
// This rule is aimed at enforcing the use of one variable declaration per function (for var)
145
145
// and multiple variable declaration per block (for let and const) scope.
146
- 'one-var' : [ 1 , {
146
+ 'one-var' : [ 'warn' , {
147
147
var : 'always' ,
148
148
let : 'never' ,
149
149
const : 'never' ,
150
150
} ] ,
151
151
152
152
// Enforces having an empty line after the last top-level import statement or require call
153
- 'import/newline-after-import' : 1 ,
153
+ 'import/newline-after-import' : 'warn' ,
154
154
} ,
155
155
}
0 commit comments