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

[v9.x backport] This is backporting multiple commits that were requested #19244

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ rules:
no-mixed-spaces-and-tabs: error
no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}]
no-restricted-syntax: [error, {
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
}, {
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])",
message: "use a regular expression for second argument of assert.throws()"
message: "Use a regular expression for second argument of assert.throws()"
}, {
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]",
message: "assert.throws() must be invoked with at least two arguments."
Expand All @@ -154,6 +157,7 @@ rules:
}]
no-tabs: error
no-trailing-spaces: error
no-unsafe-finally: error
object-curly-spacing: [error, always]
one-var-declaration-per-line: error
operator-linebreak: [error, after]
Expand Down
1 change: 1 addition & 0 deletions benchmark/assert/throws.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function main({ n, method }) {
case 'doesNotThrow':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-syntax
assert.doesNotThrow(doesNotThrow);
}
bench.end(n);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/http/_chunky_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const common = require('../common.js');
const net = require('net');

const bench = common.createBenchmark(main, {
len: [1, 4, 8, 16, 32, 64, 128],
n: [5, 50, 500, 2000],
len: [1, 4, 8, 16, 32, 64, 128],
n: [5, 50, 500, 2000],
type: ['send'],
});

Expand Down
6 changes: 3 additions & 3 deletions benchmark/tls/tls-connect.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
var fs = require('fs'),
path = require('path'),
tls = require('tls');
const fs = require('fs');
const path = require('path');
const tls = require('tls');

const common = require('../common.js');
const bench = common.createBenchmark(main, {
Expand Down
1 change: 1 addition & 0 deletions doc/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rules:
no-var: error
prefer-const: error
prefer-rest-params: error
prefer-template: error

# Stylistic Issues
no-multiple-empty-lines: [error, {max: 1, maxEOF: 0, maxBOF: 0}]
3 changes: 3 additions & 0 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ to the caller.
The following, for instance, will throw the [`TypeError`][] because there is no
matching error type in the assertion:

<!-- eslint-disable no-restricted-syntax -->
```js
assert.doesNotThrow(
() => {
Expand All @@ -358,6 +359,7 @@ assert.doesNotThrow(
However, the following will result in an `AssertionError` with the message
'Got unwanted exception (TypeError)..':

<!-- eslint-disable no-restricted-syntax -->
```js
assert.doesNotThrow(
() => {
Expand All @@ -371,6 +373,7 @@ If an `AssertionError` is thrown and a value is provided for the `message`
parameter, the value of `message` will be appended to the `AssertionError`
message:

<!-- eslint-disable no-restricted-syntax -->
```js
assert.doesNotThrow(
() => {
Expand Down
Loading