Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: disallow extra blank lines at end of files #8920

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ rules:
max-len: [2, 80, 2]
new-parens: 2
no-mixed-spaces-and-tabs: 2
no-multiple-empty-lines: [2, {max: 2}]
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about also adding maxBOF: 0 or is it better to do this in another pr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about also adding maxBOF: 0 or is it better to do this in another pr?

Sure, done, rebased, force-pushed.

no-tabs: 2
no-trailing-spaces: 2
quotes: [2, single, avoid-escape]
1 change: 0 additions & 1 deletion test/debugger/test-debugger-repl-utf8.js
Original file line number Diff line number Diff line change
@@ -4,4 +4,3 @@ var script = common.fixturesDir + '/breakpoints_utf8.js';
process.env.NODE_DEBUGGER_TEST_SCRIPT = script;

require('./test-debugger-repl.js');

1 change: 0 additions & 1 deletion test/gc/test-http-client-onerror.js
Original file line number Diff line number Diff line change
@@ -76,4 +76,3 @@ function status() {
process.exit(0);
}
}

2 changes: 0 additions & 2 deletions test/known_issues/test-stdout-buffer-flush-on-exit.js
Original file line number Diff line number Diff line change
@@ -23,5 +23,3 @@ if (process.argv[2] === 'child') {

assert.strictEqual(stdout, longLine, `failed with exponent ${exponent}`);
});


1 change: 0 additions & 1 deletion test/message/2100bytes.js
Original file line number Diff line number Diff line change
@@ -45,4 +45,3 @@ console.log([
'_____________________________________________2050',
'_____________________________________________2100'
].join('\n'));

Original file line number Diff line number Diff line change
@@ -19,4 +19,3 @@ process.on('beforeExit', common.mustCall(function onBeforeExit() {
d.run(function() {
throw new Error('boom');
});

1 change: 0 additions & 1 deletion test/parallel/test-eval-require.js
Original file line number Diff line number Diff line change
@@ -10,4 +10,3 @@ var child = spawn(process.execPath, ['-e', 'require("foo")'], options);
child.on('exit', function(code) {
assert.equal(code, 0);
});

1 change: 0 additions & 1 deletion test/parallel/test-event-emitter-special-event-names.js
Original file line number Diff line number Diff line change
@@ -33,4 +33,3 @@ process.on('__proto__', common.mustCall(function(val) {
assert.strictEqual(val, 1);
}));
process.emit('__proto__', 1);

1 change: 0 additions & 1 deletion test/parallel/test-fs-chmod.js
Original file line number Diff line number Diff line change
@@ -135,4 +135,3 @@ process.on('exit', function() {
assert.equal(0, openCount);
assert.equal(false, got_error);
});

1 change: 0 additions & 1 deletion test/parallel/test-http-client-abort2.js
Original file line number Diff line number Diff line change
@@ -14,4 +14,3 @@ server.listen(0, function() {
});
});
});

1 change: 0 additions & 1 deletion test/parallel/test-http-client-race-2.js
Original file line number Diff line number Diff line change
@@ -87,4 +87,3 @@ process.on('exit', function() {
assert.equal(body2_s, body2);
assert.equal(body3_s, body3);
});

1 change: 0 additions & 1 deletion test/parallel/test-http-exceptions.js
Original file line number Diff line number Diff line change
@@ -22,4 +22,3 @@ process.on('uncaughtException', function(err) {
if (err.name === 'AssertionError') throw err;
if (++exception_count === 4) process.exit(0);
});

1 change: 0 additions & 1 deletion test/parallel/test-http-keepalive-maxsockets.js
Original file line number Diff line number Diff line change
@@ -84,4 +84,3 @@ server.listen(0, function() {
}, 0);
}
});

1 change: 0 additions & 1 deletion test/parallel/test-http-mutable-headers.js
Original file line number Diff line number Diff line change
@@ -130,4 +130,3 @@ function nextTest() {
process.on('exit', function() {
assert.equal(4, testsComplete);
});

1 change: 0 additions & 1 deletion test/parallel/test-http-request-dont-override-options.js
Original file line number Diff line number Diff line change
@@ -43,4 +43,3 @@ http.createServer(function(req, res) {
assert.strictEqual(options.method, undefined);
});
}).unref();

1 change: 0 additions & 1 deletion test/parallel/test-http-request-end-twice.js
Original file line number Diff line number Diff line change
@@ -16,4 +16,3 @@ server.listen(0, function() {
res.resume();
});
});

1 change: 0 additions & 1 deletion test/parallel/test-http-response-readable.js
Original file line number Diff line number Diff line change
@@ -18,4 +18,3 @@ testServer.listen(0, function() {
res.resume();
});
});

1 change: 0 additions & 1 deletion test/parallel/test-http-response-statuscode.js
Original file line number Diff line number Diff line change
@@ -89,4 +89,3 @@ server.on('listening', function makeRequest() {
res.resume();
});
});

1 change: 0 additions & 1 deletion test/parallel/test-http-status-code.js
Original file line number Diff line number Diff line change
@@ -44,4 +44,3 @@ function nextTest() {
process.on('exit', function() {
assert.equal(5, testsComplete);
});

1 change: 0 additions & 1 deletion test/parallel/test-listen-fd-detached-inherit.js
Original file line number Diff line number Diff line change
@@ -95,4 +95,3 @@ function child() {
console.error('child listening on fd=3');
});
}

1 change: 0 additions & 1 deletion test/parallel/test-listen-fd-detached.js
Original file line number Diff line number Diff line change
@@ -93,4 +93,3 @@ function child() {
console.error('child listening on fd=3');
});
}

1 change: 0 additions & 1 deletion test/parallel/test-net-reconnect.js
Original file line number Diff line number Diff line change
@@ -65,4 +65,3 @@ process.on('exit', function() {
assert.equal(N + 1, client_recv_count);
assert.equal(N + 1, client_end_count);
});

1 change: 0 additions & 1 deletion test/parallel/test-next-tick-errors.js
Original file line number Diff line number Diff line change
@@ -49,4 +49,3 @@ process.on('uncaughtException', function() {
process.on('exit', function() {
assert.deepStrictEqual(['A', 'B', 'C'], order);
});

1 change: 0 additions & 1 deletion test/parallel/test-pipe-return-val.js
Original file line number Diff line number Diff line change
@@ -10,4 +10,3 @@ var destStream = new Stream();
var result = sourceStream.pipe(destStream);

assert.strictEqual(result, destStream);

1 change: 0 additions & 1 deletion test/parallel/test-pipe-stream.js
Original file line number Diff line number Diff line change
@@ -65,4 +65,3 @@ function test(clazz, cb) {
test(net.Stream, function() {
test(net.Socket);
});

1 change: 0 additions & 1 deletion test/parallel/test-regress-GH-1899.js
Original file line number Diff line number Diff line change
@@ -17,4 +17,3 @@ child.on('exit', function(code, signal) {
assert.equal(code, 0);
assert.equal(output, 'hello, world!\n');
});

1 change: 0 additions & 1 deletion test/parallel/test-stdin-pipe-resume.js
Original file line number Diff line number Diff line change
@@ -25,4 +25,3 @@ if (process.argv[2] === 'child') {
child.stdin.end();
}, 10);
}

1 change: 0 additions & 1 deletion test/parallel/test-stream2-pipe-error-once-listener.js
Original file line number Diff line number Diff line change
@@ -39,4 +39,3 @@ process.on('exit', function(c) {
});

read.pipe(write);

1 change: 0 additions & 1 deletion test/parallel/test-utf8-scripts.js
Original file line number Diff line number Diff line change
@@ -7,4 +7,3 @@ var assert = require('assert');
console.log('Σὲ γνωρίζω ἀπὸ τὴν κόψη');

assert.equal(true, /Hellö Wörld/.test('Hellö Wörld'));

1 change: 0 additions & 1 deletion test/parallel/test-vm-create-context-circular-reference.js
Original file line number Diff line number Diff line change
@@ -11,4 +11,3 @@ sbx = vm.createContext(sbx);
sbx.test = 123;

assert.equal(sbx.window.window.window.window.window.test, 123);