Skip to content

Commit b5d7fa4

Browse files
Tweak eslint rules (#594)
* Remove unneeded disabling of no-inner-declarations No reason to have this turned off; we don't violate the rule anywhere and I don't think I've ever worked on a codebase that did violate it tbh * Tweak comment to explain why no-unused-expressions needs disabling in tests * Remove lines setting rules to 0 - they don't do anything Maybe in an old version of eslint, these disabled on-by-default rules, but there ARE no on-by-default rules in the latest version of eslint, so these lines have no effect. Seems like deleting them all simplifies the config. * Remove more unnecessary setting of rules to 0, and a couple of stray console.log lines
1 parent 590f4f2 commit b5d7fa4

File tree

3 files changed

+2
-41
lines changed

3 files changed

+2
-41
lines changed

eslint.config.mjs

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,28 @@ export default [
3030
"no-extra-parens": [2, "functions"],
3131
"no-extra-semi": 2,
3232
"no-func-assign": 2,
33-
"no-inner-declarations": 0, // Stylistic... might consider disallowing in the future
3433
"no-invalid-regexp": 2,
3534
"no-irregular-whitespace": 2,
3635
"no-negated-in-lhs": 2,
3736
"no-obj-calls": 2,
3837
"no-regex-spaces": 2,
39-
"no-sparse-arrays": 0,
4038
"no-unreachable": 1, // Optimizer and coverage will handle/highlight this and can be useful for debugging
4139
"use-isnan": 2,
42-
"valid-jsdoc": 0,
4340
"valid-typeof": 2,
4441

4542
// Best Practices //
4643
//----------------//
47-
"block-scoped-var": 0,
48-
complexity: 0,
49-
"consistent-return": 0,
5044
curly: 2,
5145
"default-case": 1,
5246

5347
"dot-notation": [2, {
5448
allowKeywords: false,
5549
}],
5650

57-
eqeqeq: 0,
5851
"guard-for-in": 1,
5952
"no-alert": 2,
6053
"no-caller": 2,
6154
"no-div-regex": 1,
62-
"no-else-return": 0,
63-
"no-eq-null": 0,
6455
"no-eval": 2,
6556
"no-extend-native": 2,
6657
"no-extra-bind": 2,
@@ -70,7 +61,6 @@ export default [
7061
"no-iterator": 2,
7162
"no-labels": 2,
7263
"no-lone-blocks": 2,
73-
"no-loop-func": 0,
7464
"no-multi-spaces": 2,
7565
"no-multi-str": 1,
7666
"no-native-reassign": 2,
@@ -79,7 +69,6 @@ export default [
7969
"no-new-wrappers": 2,
8070
"no-octal": 2,
8171
"no-octal-escape": 2,
82-
"no-param-reassign": 0,
8372
"no-process-env": 2,
8473
"no-proto": 2,
8574
"no-redeclare": 2,
@@ -89,28 +78,18 @@ export default [
8978
"no-sequences": 2,
9079
"no-throw-literal": 2,
9180
"no-unused-expressions": 2,
92-
"no-void": 0,
9381
"no-warning-comments": 1,
9482
"no-with": 2,
9583
radix: 2,
96-
"vars-on-top": 0,
9784
"wrap-iife": 2,
98-
yoda: 0,
99-
100-
// Strict //
101-
//--------//
102-
strict: 0,
10385

10486
// Variables //
10587
//-----------//
10688
"no-catch-shadow": 2,
10789
"no-delete-var": 2,
10890
"no-label-var": 2,
109-
"no-shadow": 0,
110-
"no-shadow-restricted-names": 0,
11191
"no-undef": 2,
11292
"no-undef-init": 2,
113-
"no-undefined": 0,
11493

11594
"no-unused-vars": [2, {
11695
vars: "all",
@@ -121,11 +100,9 @@ export default [
121100

122101
// Node.js //
123102
//---------//
124-
"no-mixed-requires": 0, // Others left to environment defaults
125103

126104
// Stylistic //
127105
//-----------//
128-
indent: 0,
129106
"brace-style": [2, "1tbs", {
130107
allowSingleLine: true,
131108
}],
@@ -140,33 +117,22 @@ export default [
140117
"comma-style": [2, "last"],
141118
"consistent-this": [1, "self"],
142119
"eol-last": 2,
143-
"func-names": 0,
144120
"func-style": [2, "declaration"],
145121

146122
"key-spacing": [2, {
147123
beforeColon: false,
148124
afterColon: true,
149125
}],
150126

151-
"max-nested-callbacks": 0,
152127
"new-cap": 2,
153128
"new-parens": 2,
154-
"newline-after-var": 0,
155129
"no-array-constructor": 2,
156-
"no-continue": 0,
157-
"no-inline-comments": 0,
158130
"no-lonely-if": 2,
159131
"no-mixed-spaces-and-tabs": 2,
160-
"no-multiple-empty-lines": 0,
161132
"no-nested-ternary": 1,
162133
"no-new-object": 2,
163134
"no-spaced-func": 2,
164-
"no-ternary": 0,
165135
"no-trailing-spaces": 2,
166-
"no-underscore-dangle": 0,
167-
"one-var": 0,
168-
"operator-assignment": 0,
169-
"padded-blocks": 0,
170136

171137
"quote-props": [2, "as-needed", {
172138
keywords: true,
@@ -180,15 +146,13 @@ export default [
180146
after: true,
181147
}],
182148

183-
"sort-vars": 0,
184149
"space-before-blocks": [2, "always"],
185150

186151
"space-before-function-paren": [2, {
187152
anonymous: "never",
188153
named: "never",
189154
}],
190155

191-
"space-in-brackets": 0,
192156
"space-in-parens": [2, "never"],
193157
"space-infix-ops": 2,
194158
"space-unary-ops": 2,
@@ -206,9 +170,7 @@ export default [
206170
},
207171
},
208172
rules: {
209-
"no-unused-expressions": 0, // Disabling for tests, for now.
210-
"no-path-concat": 0,
211-
"no-console": 0,
173+
"no-unused-expressions": 0, // Needs disabling to support Chai `.to.be.undefined` etc syntax
212174
},
213175
}
214176
];

test/diff/array.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ describe('diff/array', function() {
77
it('Should diff arrays', function() {
88
const a = {a: 0}, b = {b: 1}, c = {c: 2};
99
const diffResult = diffArrays([a, b, c], [a, c, b]);
10-
console.log(diffResult);
1110
expect(diffResult).to.deep.equals([
1211
{count: 1, value: [a], removed: false, added: false},
1312
{count: 1, value: [b], removed: true, added: false},
@@ -68,7 +67,6 @@ describe('diff/array', function() {
6867
return left.a === right.a;
6968
}
7069
const diffResult = diffArrays([a, b, c], [a, b, d], { comparator: comparator });
71-
console.log(diffResult);
7270
expect(diffResult).to.deep.equals([
7371
{count: 2, value: [a, b], removed: false, added: false},
7472
{count: 1, value: [c], removed: true, added: false},

test/patch/create.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {expect} from 'chai';
66

77
const VERBOSE = false;
88
function log() {
9+
// eslint-disable-next-line no-console
910
VERBOSE && console.log.apply(console, arguments);
1011
}
1112

0 commit comments

Comments
 (0)