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 no-useless-constructor lint rule · nodejs/node@694ea00

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .eslintrc.js
  • doc/api
    • stream.md
  • lib
    • perf_hooks.js
    • v8.js
  • test/parallel
    • test-stream-writable-null.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
@@ -223,6 +223,7 @@ module.exports = {
223223
}],
224224
'no-useless-call': 'error',
225225
'no-useless-concat': 'error',
226+
'no-useless-constructor': 'error',
226227
'no-useless-escape': 'error',
227228
'no-useless-return': 'error',
228229
'no-void': 'error',
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,7 @@ of the four basic stream classes (`stream.Writable`, `stream.Readable`,
14411441
`stream.Duplex`, or `stream.Transform`), making sure they call the appropriate
14421442
parent class constructor:
14431443

1444+
<!-- eslint-disable no-useless-constructor -->
14441445
```js
14451446
const { Writable } = require('stream');
14461447

@@ -1531,6 +1532,7 @@ changes:
15311532
* `final` {Function} Implementation for the
15321533
[`stream._final()`][stream-_final] method.
15331534

1535+
<!-- eslint-disable no-useless-constructor -->
15341536
```js
15351537
const { Writable } = require('stream');
15361538

@@ -1702,11 +1704,6 @@ required elements of a custom [`Writable`][] stream instance:
17021704
const { Writable } = require('stream');
17031705

17041706
class MyWritable extends Writable {
1705-
constructor(options) {
1706-
super(options);
1707-
// ...
1708-
}
1709-
17101707
_write(chunk, encoding, callback) {
17111708
if (chunk.toString().indexOf('a') >= 0) {
17121709
callback(new Error('chunk is invalid'));
@@ -1780,6 +1777,7 @@ constructor and implement the `readable._read()` method.
17801777
* `destroy` {Function} Implementation for the
17811778
[`stream._destroy()`][readable-_destroy] method.
17821779

1780+
<!-- eslint-disable no-useless-constructor -->
17831781
```js
17841782
const { Readable } = require('stream');
17851783

@@ -2038,6 +2036,7 @@ changes:
20382036
* `writableHighWaterMark` {number} Sets `highWaterMark` for the writable side
20392037
of the stream. Has no effect if `highWaterMark` is provided.
20402038

2039+
<!-- eslint-disable no-useless-constructor -->
20412040
```js
20422041
const { Duplex } = require('stream');
20432042

@@ -2192,6 +2191,7 @@ output on the `Readable` side is not consumed.
21922191
* `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush]
21932192
method.
21942193

2194+
<!-- eslint-disable no-useless-constructor -->
21952195
```js
21962196
const { Transform } = require('stream');
21972197

Collapse file

‎lib/perf_hooks.js‎

Copy file name to clipboardExpand all lines: lib/perf_hooks.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ function getMilestoneTimestamp(milestoneIdx) {
142142
}
143143

144144
class PerformanceNodeTiming {
145-
constructor() {}
146-
147145
get name() {
148146
return 'node';
149147
}
Collapse file

‎lib/v8.js‎

Copy file name to clipboardExpand all lines: lib/v8.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,6 @@ class DefaultSerializer extends Serializer {
173173
}
174174

175175
class DefaultDeserializer extends Deserializer {
176-
constructor(buffer) {
177-
super(buffer);
178-
}
179-
180176
_readHostObject() {
181177
const typeIndex = this.readUint32();
182178
const ctor = arrayBufferViewTypes[typeIndex];
Collapse file

‎test/parallel/test-stream-writable-null.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-writable-null.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const assert = require('assert');
55
const stream = require('stream');
66

77
class MyWritable extends stream.Writable {
8-
constructor(opt) {
9-
super(opt);
10-
}
11-
128
_write(chunk, encoding, callback) {
139
assert.notStrictEqual(chunk, null);
1410
callback();

0 commit comments

Comments
0 (0)
You are visitor 01402520 — 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.