GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: enable ESLint no-sparse-arrays rule · nodejs/node@8090ce7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .eslintrc.js
  • lib/internal/modules/esm
    • get_format.js
  • test/parallel
    • test-assert-deep.js
    • test-util-inspect.js
    • test-util-isDeepStrictEqual.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ module.exports = {
275275
'no-self-compare': 'error',
276276
'no-setter-return': 'error',
277277
'no-shadow-restricted-names': 'error',
278+
'no-sparse-arrays': 'error',
278279
'no-tabs': 'error',
279280
'no-template-curly-in-string': 'error',
280281
'no-this-before-super': 'error',
Collapse file

‎lib/internal/modules/esm/get_format.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/get_format.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const protocolHandlers = ObjectAssign(ObjectCreate(null), {
4545
const { 1: mime } = RegExpPrototypeExec(
4646
/^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/,
4747
parsed.pathname,
48-
) || [, null];
48+
) || [, null]; // eslint-disable-line no-sparse-arrays
4949
const format = ({
5050
'__proto__': null,
5151
'text/javascript': 'module',
Collapse file

‎test/parallel/test-assert-deep.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert-deep.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,10 @@ assertNotDeepOrStrict(
567567

568568
// Handle sparse arrays.
569569
{
570+
/* eslint-disable no-sparse-arrays */
570571
assertDeepAndStrictEqual([1, , , 3], [1, , , 3]);
571572
assertNotDeepOrStrict([1, , , 3], [1, , , 3, , , ]);
573+
/* eslint-enable no-sparse-arrays */
572574
const a = new Array(3);
573575
const b = new Array(3);
574576
a[2] = true;
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ assert.strictEqual(
434434

435435
// Array with extra properties.
436436
{
437-
const arr = [1, 2, 3, , ];
437+
const arr = [1, 2, 3, , ]; // eslint-disable-line no-sparse-arrays
438438
arr.foo = 'bar';
439439
assert.strictEqual(util.inspect(arr),
440440
"[ 1, 2, 3, <1 empty item>, foo: 'bar' ]");
@@ -2142,6 +2142,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'");
21422142
[function() {}, '[Function (anonymous)]'],
21432143
[() => {}, '[Function (anonymous)]'],
21442144
[[1, 2], '[ 1, 2 ]'],
2145+
// eslint-disable-next-line no-sparse-arrays
21452146
[[, , 5, , , , ], '[ <2 empty items>, 5, <3 empty items> ]'],
21462147
[{ a: 5 }, '{ a: 5 }'],
21472148
[new Set([1, 2]), 'Set(2) { 1, 2 }'],
Collapse file

‎test/parallel/test-util-isDeepStrictEqual.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-isDeepStrictEqual.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ notUtilIsDeepStrict(
409409
}
410410

411411
// Handle sparse arrays
412+
/* eslint-disable no-sparse-arrays */
412413
utilIsDeepStrict([1, , , 3], [1, , , 3]);
413414
notUtilIsDeepStrict([1, , , 3], [1, , , 3, , , ]);
415+
/* eslint-enable no-sparse-arrays */
414416

415417
// Handle different error messages
416418
{

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.