Skip to content

Commit 867f770

Browse files
feat: update dependencies + add new globals (#114)
1 parent 5547139 commit 867f770

File tree

6 files changed

+181
-156
lines changed

6 files changed

+181
-156
lines changed

lib/configs/_base.js

Lines changed: 77 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/**
2-
* @author Toru Nagashima
3-
* See LICENSE file in root directory for full license.
4-
*/
51
"use strict"
62

73
const { Linter } = require("eslint")
84
const semver = require("semver")
95

106
const isESLint7OrHigher = semver.gte(Linter.version, "7.0.0")
117
const isESLint8OrHigher = semver.gte(Linter.version, "8.0.0")
8+
const isESLint850OrHigher = semver.gte(Linter.version, "8.50.0")
9+
const isESLint853OrHigher = semver.gte(Linter.version, "8.53.0")
1210

1311
/** @type {import('eslint').Linter.Config} */
1412
module.exports = {
@@ -43,10 +41,7 @@ module.exports = {
4341
"getter-return": "error",
4442
"grouped-accessor-pairs": "error",
4543
"init-declarations": "error",
46-
"linebreak-style": ["error", "unix"],
47-
"lines-between-class-members": "error",
4844
...(isESLint8OrHigher ? { "logical-assignment-operators": "off" } : {}), // TODO: enable once we drop ESLint v7 support
49-
"max-statements-per-line": ["error", { max: 1 }],
5045
"multiline-comment-style": ["error", "separate-lines"],
5146
"new-cap": "error",
5247
"no-alert": "error",
@@ -107,21 +102,14 @@ module.exports = {
107102
"no-loop-func": "error",
108103
...(isESLint7OrHigher ? { "no-loss-of-precision": "off" } : {}), // TODO: enable once we drop ESLint v6 support
109104
"no-misleading-character-class": "error",
110-
"no-mixed-operators": [
111-
"error",
112-
{
113-
groups: [
114-
["&", "|", "^", "~", "<<", ">>", ">>>"],
115-
["&&", "||"],
116-
],
117-
},
118-
],
119105
"no-new": "error",
120106
...(isESLint8OrHigher ? { "no-new-native-nonconstructor": "off" } : {}), // TODO: enable once we drop ESLint v7 support
121-
"no-new-object": "error",
122107
"no-new-require": "error",
123108
"no-new-wrappers": "error",
124109
...(isESLint7OrHigher ? { "no-nonoctal-decimal-escape": "off" } : {}), // TODO: enable once we drop ESLint v6 support
110+
...(isESLint850OrHigher
111+
? { "no-object-constructor": "error" }
112+
: { "no-new-object": "error" }), // TODO: remove once we drop ESLint v8.50 support
125113
"no-obj-calls": "error",
126114
"no-octal": "error",
127115
"no-octal-escape": "error",
@@ -152,7 +140,6 @@ module.exports = {
152140
"no-shadow": ["error", { builtinGlobals: true }],
153141
"no-shadow-restricted-names": "error",
154142
"no-sparse-arrays": "error",
155-
"no-tabs": "error",
156143
"no-throw-literal": "error",
157144
"no-undef": ["error", { typeof: true }],
158145
"no-unexpected-multiline": "error",
@@ -194,48 +181,13 @@ module.exports = {
194181
uninitialized: "always",
195182
},
196183
],
197-
"padding-line-between-statements": [
198-
"error",
199-
{ blankLine: "always", next: "*", prev: "directive" },
200-
{ blankLine: "always", next: "function", prev: "*" },
201-
{ blankLine: "always", next: "*", prev: "function" },
202-
],
203184
"prefer-exponentiation-operator": "error",
204185
...(isESLint8OrHigher ? { "prefer-object-has-own": "off" } : {}), // TODO: enable once we drop ESLint v7 support
205186
"prefer-promise-reject-errors": "error",
206187
"prefer-regex-literals": "error",
207-
quotes: ["error", "double", { avoidEscape: true }],
208188
radix: "error",
209189
"require-atomic-updates": "error",
210190
"require-await": "error",
211-
"spaced-comment": [
212-
"error",
213-
"always",
214-
{
215-
block: {
216-
balanced: true,
217-
markers: [
218-
"eslint",
219-
"eslint-env",
220-
"eslint-disable",
221-
"eslint-enable",
222-
"exported",
223-
"globals",
224-
"istanbul",
225-
],
226-
},
227-
line: {
228-
exceptions: ["-", "="],
229-
markers: [
230-
"eslint-disable-line",
231-
"eslint-disable-next-line",
232-
"istanbul",
233-
"TODO:",
234-
"FIXME:",
235-
],
236-
},
237-
},
238-
],
239191
strict: ["error", "global"],
240192
"use-isnan": [
241193
"error",
@@ -250,64 +202,77 @@ module.exports = {
250202
"max-params": ["warn", { max: 8 }],
251203
"no-console": ["warn", { allow: ["assert", "error"] }],
252204

253-
// Disabled rules as favor of Prettier.
254-
"array-bracket-newline": "off",
255-
"array-bracket-spacing": "off",
256-
"array-element-newline": "off",
257-
"arrow-parens": "off",
258-
"arrow-spacing": "off",
259-
"block-spacing": "off",
260-
"brace-style": "off",
261-
"comma-dangle": "off",
262-
"comma-spacing": "off",
263-
"comma-style": "off",
264-
"computed-property-spacing": "off",
265-
"dot-location": "off",
266-
"eol-last": "off",
267-
"func-call-spacing": "off",
268-
"function-call-argument-newline": "off",
269-
"function-paren-newline": "off",
270-
"generator-star-spacing": "off",
271-
"implicit-arrow-linebreak": "off",
272-
indent: "off",
273-
"jsx-quotes": "off",
274-
"key-spacing": "off",
275-
"keyword-spacing": "off",
276-
"multiline-ternary": "off",
277-
"new-parens": "off",
278-
"newline-per-chained-call": "off",
279-
"no-extra-parens": "off",
280-
"no-extra-semi": "off",
281-
"no-floating-decimal": "off",
282-
"no-mixed-spaces-and-tabs": "off",
283-
"no-multi-spaces": "off",
284-
"no-multiple-empty-lines": "off",
285-
"no-trailing-spaces": "off",
286-
"no-whitespace-before-property": "off",
287-
"nonblock-statement-body-position": "off",
288-
"object-curly-newline": "off",
289-
"object-curly-spacing": "off",
290-
"object-property-newline": "off",
291-
"one-var-declaration-per-line": "off",
292-
"operator-linebreak": "off",
293-
"padded-blocks": "off",
294-
"quote-props": "off",
295-
"rest-spread-spacing": "off",
296-
semi: "off",
297-
"semi-spacing": "off",
298-
"semi-style": "off",
299-
"space-before-blocks": "off",
300-
"space-before-function-paren": "off",
301-
"space-in-parens": "off",
302-
"space-infix-ops": "off",
303-
"space-unary-ops": "off",
304-
"switch-colon-spacing": "off",
305-
"template-curly-spacing": "off",
306-
"template-tag-spacing": "off",
307-
"unicode-bom": "off",
308-
"wrap-iife": "off",
309-
"wrap-regex": "off",
310-
"yield-star-spacing": "off",
205+
...(isESLint853OrHigher
206+
? {}
207+
: {
208+
"array-bracket-newline": "off",
209+
"array-bracket-spacing": "off",
210+
"array-element-newline": "off",
211+
"arrow-parens": "off",
212+
"arrow-spacing": "off",
213+
"block-spacing": "off",
214+
"brace-style": "off",
215+
"comma-dangle": "off",
216+
"comma-spacing": "off",
217+
"comma-style": "off",
218+
"computed-property-spacing": "off",
219+
"dot-location": "off",
220+
"eol-last": "off",
221+
"func-call-spacing": "off",
222+
"function-call-argument-newline": "off",
223+
"function-paren-newline": "off",
224+
"generator-star-spacing": "off",
225+
"implicit-arrow-linebreak": "off",
226+
indent: "off",
227+
"jsx-quotes": "off",
228+
"key-spacing": "off",
229+
"keyword-spacing": "off",
230+
"linebreak-style": "off",
231+
"lines-around-comment": "off",
232+
"lines-between-class-members": "off",
233+
"max-len": "off",
234+
"max-statements-per-line": "off",
235+
"multiline-ternary": "off",
236+
"new-parens": "off",
237+
"newline-per-chained-call": "off",
238+
"no-confusing-arrow": "off",
239+
"no-extra-parens": "off",
240+
"no-extra-semi": "off",
241+
"no-floating-decimal": "off",
242+
"no-mixed-operators": "off",
243+
"no-mixed-spaces-and-tabs": "off",
244+
"no-multi-spaces": "off",
245+
"no-multiple-empty-lines": "off",
246+
"no-tabs": "off",
247+
"no-trailing-spaces": "off",
248+
"no-whitespace-before-property": "off",
249+
"nonblock-statement-body-position": "off",
250+
"object-curly-newline": "off",
251+
"object-curly-spacing": "off",
252+
"object-property-newline": "off",
253+
"one-var-declaration-per-line": "off",
254+
"operator-linebreak": "off",
255+
"padded-blocks": "off",
256+
"padding-line-between-statements": "off",
257+
"quote-props": "off",
258+
quotes: "off",
259+
"rest-spread-spacing": "off",
260+
semi: "off",
261+
"semi-spacing": "off",
262+
"semi-style": "off",
263+
"space-before-blocks": "off",
264+
"space-before-function-paren": "off",
265+
"space-in-parens": "off",
266+
"space-infix-ops": "off",
267+
"space-unary-ops": "off",
268+
"spaced-comment": "off",
269+
"switch-colon-spacing": "off",
270+
"template-curly-spacing": "off",
271+
"template-tag-spacing": "off",
272+
"wrap-iife": "off",
273+
"wrap-regex": "off",
274+
"yield-star-spacing": "off",
275+
}), // TODO: remove once we drop ESLint v8.53 support
311276

312277
// Disabled rules
313278
"arrow-body-style": "off",
@@ -327,18 +292,15 @@ module.exports = {
327292
"id-length": "off",
328293
"id-match": "off",
329294
"line-comment-position": "off",
330-
"lines-around-comment": "off",
331295
"max-classes-per-file": "off",
332296
"max-depth": "off",
333-
"max-len": "off",
334297
"max-lines": "off",
335298
"max-lines-per-function": "off",
336299
"max-statements": "off",
337300
"no-await-in-loop": "off",
338301
"no-bitwise": "off",
339302
"no-buffer-constructor": "off",
340303
"no-class-assign": "off",
341-
"no-confusing-arrow": "off",
342304
"no-const-assign": "off",
343305
"no-continue": "off",
344306
"no-dupe-class-members": "off",
@@ -391,6 +353,7 @@ module.exports = {
391353
"sort-keys": "off",
392354
"sort-vars": "off",
393355
"symbol-description": "off",
356+
"unicode-bom": "off",
394357
"vars-on-top": "off",
395358

396359
//

lib/configs/_browser-globals.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module.exports = {
7979
CloseEvent: "readonly",
8080
Comment: "readonly",
8181
CompositionEvent: "readonly",
82+
CompressionStream: "readonly",
8283
ConstantSourceNode: "readonly",
8384
ConvolverNode: "readonly",
8485
CountQueuingStrategy: "readonly",
@@ -106,6 +107,7 @@ module.exports = {
106107
DataTransfer: "readonly",
107108
DataTransferItem: "readonly",
108109
DataTransferItemList: "readonly",
110+
DecompressionStream: "readonly",
109111
DelayNode: "readonly",
110112
DeviceMotionEvent: "readonly",
111113
DeviceOrientationEvent: "readonly",
@@ -265,6 +267,7 @@ module.exports = {
265267
MediaStream: "readonly",
266268
MediaStreamAudioDestinationNode: "readonly",
267269
MediaStreamAudioSourceNode: "readonly",
270+
MediaStreamConstraints: "readonly",
268271
MediaStreamEvent: "readonly",
269272
MediaStreamTrack: "readonly",
270273
MediaStreamTrackEvent: "readonly",
@@ -353,7 +356,12 @@ module.exports = {
353356
RTCTrackEvent: "readonly",
354357
RadioNodeList: "readonly",
355358
Range: "readonly",
359+
ReadableByteStreamController: "readonly",
356360
ReadableStream: "readonly",
361+
ReadableStreamBYOBReader: "readonly",
362+
ReadableStreamBYOBRequest: "readonly",
363+
ReadableStreamDefaultController: "readonly",
364+
ReadableStreamDefaultReader: "readonly",
357365
RemotePlayback: "readonly",
358366
Request: "readonly",
359367
ResizeObserver: "readonly",
@@ -483,19 +491,23 @@ module.exports = {
483491
TaskAttributionTiming: "readonly",
484492
Text: "readonly",
485493
TextDecoder: "readonly",
494+
TextDecoderStream: "readonly",
486495
TextEncoder: "readonly",
496+
TextEncoderStream: "readonly",
487497
TextEvent: "readonly",
488498
TextMetrics: "readonly",
489499
TextTrack: "readonly",
490500
TextTrackCue: "readonly",
491501
TextTrackCueList: "readonly",
492502
TextTrackList: "readonly",
493503
TimeRanges: "readonly",
504+
ToggleEvent: "readonly",
494505
Touch: "readonly",
495506
TouchEvent: "readonly",
496507
TouchList: "readonly",
497508
TrackEvent: "readonly",
498509
TransformStream: "readonly",
510+
TransformStreamDefaultController: "readonly",
499511
TransitionEvent: "readonly",
500512
TreeWalker: "readonly",
501513
UIEvent: "readonly",
@@ -528,6 +540,8 @@ module.exports = {
528540
Window: "readonly",
529541
Worker: "readonly",
530542
WritableStream: "readonly",
543+
WritableStreamDefaultController: "readonly",
544+
WritableStreamDefaultWriter: "readonly",
531545
XMLDocument: "readonly",
532546
XMLHttpRequest: "readonly",
533547
XMLHttpRequestEventTarget: "readonly",
@@ -536,6 +550,30 @@ module.exports = {
536550
XPathEvaluator: "readonly",
537551
XPathExpression: "readonly",
538552
XPathResult: "readonly",
553+
XRAnchor: "readonly",
554+
XRBoundedReferenceSpace: "readonly",
555+
XRCPUDepthInformation: "readonly",
556+
XRDepthInformation: "readonly",
557+
XRFrame: "readonly",
558+
XRInputSource: "readonly",
559+
XRInputSourceArray: "readonly",
560+
XRInputSourceEvent: "readonly",
561+
XRInputSourcesChangeEvent: "readonly",
562+
XRPose: "readonly",
563+
XRReferenceSpace: "readonly",
564+
XRReferenceSpaceEvent: "readonly",
565+
XRRenderState: "readonly",
566+
XRRigidTransform: "readonly",
567+
XRSession: "readonly",
568+
XRSessionEvent: "readonly",
569+
XRSpace: "readonly",
570+
XRSystem: "readonly",
571+
XRView: "readonly",
572+
XRViewerPose: "readonly",
573+
XRViewport: "readonly",
574+
XRWebGLBinding: "readonly",
575+
XRWebGLDepthInformation: "readonly",
576+
XRWebGLLayer: "readonly",
539577
XSLTProcessor: "readonly",
540578
atob: "readonly",
541579
btoa: "readonly",

lib/configs/_override-2015.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
/**
2-
* @author Toru Nagashima
3-
* See LICENSE file in root directory for full license.
4-
*/
51
"use strict"
62

3+
/** @type {import('eslint').Linter.Config} */
74
module.exports = {
85
parserOptions: {
96
ecmaVersion: 2015,
@@ -68,12 +65,11 @@ module.exports = {
6865
"arrow-parens": "off",
6966
"arrow-spacing": "off",
7067
"generator-star-spacing": "off",
71-
"no-confusing-arrow": "off",
7268
"rest-spread-spacing": "off",
7369
"template-curly-spacing": "off",
7470
"yield-star-spacing": "off",
7571

76-
// Desabled rules
72+
// Disabled rules
7773
"no-inner-declarations": "off",
7874
"no-restricted-imports": "off",
7975
"prefer-destructuring": "off",

0 commit comments

Comments
 (0)