@tim-code/eslint-config 0.6.3 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +4 -3
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -58,8 +58,6 @@ module.exports = {
|
|
|
58
58
|
"multiline-comment-style": ["error", "separate-lines"],
|
|
59
59
|
// errors need to be logged somehow
|
|
60
60
|
"no-console": ["error", { allow: ["error"] }],
|
|
61
|
-
// max 10 statements is way too low
|
|
62
|
-
"max-statements": ["error", 20],
|
|
63
61
|
// default is 50 lines which is fine but adding comments or blanks should not trigger this warning
|
|
64
62
|
"max-lines-per-function": ["error", { max: 50, skipBlankLines: true, skipComments: true }],
|
|
65
63
|
// allow mix of reassigned and const variables
|
|
@@ -69,13 +67,15 @@ module.exports = {
|
|
|
69
67
|
"no-labels": "off", // useful to be able to break/continue an outer loop; otherwise have to write more code
|
|
70
68
|
|
|
71
69
|
// rule is too idealistic
|
|
72
|
-
camelcase: "off", // useful to allow non-
|
|
70
|
+
camelcase: "off", // useful to allow non-camel case for compatibility like destructuring JSON
|
|
73
71
|
"sort-keys": "off", // too burdensome; doesn't affect order of destructured properties i.e. ({b, a}) => ({a, b}) would be fine
|
|
74
72
|
"no-param-reassign": "off", // a common pattern is to coerce parameters; noisy to rename parameters slightly differently
|
|
75
73
|
"no-magic-numbers": "off", // does not allow 1, 2, -1; also sometimes noisy to name every constant (for example in time calculations)
|
|
76
74
|
"id-length": "off", // single character variables can sometimes be useful: i, j, x, y, $, _
|
|
77
75
|
"no-plusplus": "off", // ++ is too common of a language feature (C++)
|
|
78
76
|
"no-underscore-dangle": "off", // difficult to come up with other names for named default parameters
|
|
77
|
+
"max-statements": "off", // max 10 statements is way too low; unclear why number of statements is a good measurement
|
|
78
|
+
"class-methods-use-this": "off", // possible to want a possible static method to be called like an instance method
|
|
79
79
|
|
|
80
80
|
// rule conflicts with another tool
|
|
81
81
|
"one-var": "off", // with Prettier, comma appears on the same line as declaration, making code less readable
|
|
@@ -92,5 +92,6 @@ module.exports = {
|
|
|
92
92
|
"no-inline-comments": "off", // not adhered to in this file for example
|
|
93
93
|
"line-comment-position": "off", // relates to above rule
|
|
94
94
|
"no-loop-func": "off", // this is only a concern with var declarations
|
|
95
|
+
"max-classes-per-file": "off", // one class per file discourages small classes
|
|
95
96
|
},
|
|
96
97
|
}
|