Skip to content

Commit

Permalink
lib: add trailing commas to all public core modules
Browse files Browse the repository at this point in the history
PR-URL: #46848
Reviewed-By: Debadree Chatterjee <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
  • Loading branch information
aduh95 committed Feb 28, 2023
1 parent 1101713 commit 9dbb162
Show file tree
Hide file tree
Showing 30 changed files with 212 additions and 243 deletions.
33 changes: 1 addition & 32 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,58 +264,27 @@ globals:
overrides:
- files:
- ./*/*.js
- ./_*.js
- ./child_process.js
- ./cluster.js
- ./console.js
- ./constants.js
- ./events.js
- ./fs.js
- ./internal/assert.js
- ./internal/child_process.js
- ./*.js
- ./internal/child_process/*.js
- ./internal/cli_table.js
- ./internal/cluster/*.js
- ./internal/debugger/*.js
- ./internal/event_target.js
- ./internal/events/*.js
- ./internal/fixed_queue.js
- ./internal/freelist.js
- ./internal/fs/*.js
- ./internal/heap_utils.js
- ./internal/http.js
- ./internal/idna.js
- ./internal/js_stream_socket.js
- ./internal/mime.js
- ./internal/modules/*.js
- ./internal/per_context/*.js
- ./internal/perf/*.js
- ./internal/policy/*.js
- ./internal/priority_queue.js
- ./internal/process/*.js
- ./internal/readline/*.js
- ./internal/readme.md
- ./internal/repl.js
- ./internal/repl/*.js
- ./internal/source_map/*.js
- ./internal/streams/*.js
- ./internal/structured_clone.js
- ./internal/test/*.js
- ./internal/test_runner/**/*.js
- ./internal/tls/*.js
- ./internal/util/parse_args/*.js
- ./internal/v8_prof_processor.js
- ./internal/vm.js
- ./internal/watch_mode/*.js
- ./internal/webidl.js
- ./internal/webstreams/*.js
- ./module.js
- ./process.js
- ./punycode.js
- ./repl.js
- ./sys.js
- ./test.js
- ./tls.js
- ./url.js
rules:
comma-dangle: [error, always-multiline]
38 changes: 19 additions & 19 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function fail(actual, expected, message, operator, stackStartFn) {
expected,
operator: operator === undefined ? 'fail' : operator,
stackStartFn: stackStartFn || fail,
message
message,
};
const err = new AssertionError(errArgs);
if (internalMessage) {
Expand Down Expand Up @@ -393,7 +393,7 @@ function innerOk(fn, argLen, value, message) {
expected: true,
message,
operator: '==',
stackStartFn: fn
stackStartFn: fn,
});
err.generatedMessage = generatedMessage;
throw err;
Expand Down Expand Up @@ -430,7 +430,7 @@ assert.equal = function equal(actual, expected, message) {
expected,
message,
operator: '==',
stackStartFn: equal
stackStartFn: equal,
});
}
};
Expand All @@ -454,7 +454,7 @@ assert.notEqual = function notEqual(actual, expected, message) {
expected,
message,
operator: '!=',
stackStartFn: notEqual
stackStartFn: notEqual,
});
}
};
Expand All @@ -477,7 +477,7 @@ assert.deepEqual = function deepEqual(actual, expected, message) {
expected,
message,
operator: 'deepEqual',
stackStartFn: deepEqual
stackStartFn: deepEqual,
});
}
};
Expand All @@ -500,7 +500,7 @@ assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
expected,
message,
operator: 'notDeepEqual',
stackStartFn: notDeepEqual
stackStartFn: notDeepEqual,
});
}
};
Expand All @@ -525,7 +525,7 @@ assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
expected,
message,
operator: 'deepStrictEqual',
stackStartFn: deepStrictEqual
stackStartFn: deepStrictEqual,
});
}
};
Expand All @@ -550,7 +550,7 @@ function notDeepStrictEqual(actual, expected, message) {
expected,
message,
operator: 'notDeepStrictEqual',
stackStartFn: notDeepStrictEqual
stackStartFn: notDeepStrictEqual,
});
}
}
Expand All @@ -572,7 +572,7 @@ assert.strictEqual = function strictEqual(actual, expected, message) {
expected,
message,
operator: 'strictEqual',
stackStartFn: strictEqual
stackStartFn: strictEqual,
});
}
};
Expand All @@ -594,7 +594,7 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
expected,
message,
operator: 'notStrictEqual',
stackStartFn: notStrictEqual
stackStartFn: notStrictEqual,
});
}
};
Expand Down Expand Up @@ -627,7 +627,7 @@ function compareExceptionKey(actual, expected, key, message, keys, fn) {
actual: a,
expected: b,
operator: 'deepStrictEqual',
stackStartFn: fn
stackStartFn: fn,
});
err.actual = actual;
err.expected = expected;
Expand All @@ -639,7 +639,7 @@ function compareExceptionKey(actual, expected, key, message, keys, fn) {
expected,
message,
operator: fn.name,
stackStartFn: fn
stackStartFn: fn,
});
}
}
Expand Down Expand Up @@ -668,7 +668,7 @@ function expectedException(actual, expected, message, fn) {
expected,
message,
operator: 'deepStrictEqual',
stackStartFn: fn
stackStartFn: fn,
});
err.operator = fn.name;
throw err;
Expand Down Expand Up @@ -743,7 +743,7 @@ function expectedException(actual, expected, message, fn) {
expected,
message,
operator: fn.name,
stackStartFn: fn
stackStartFn: fn,
});
err.generatedMessage = generatedMessage;
throw err;
Expand Down Expand Up @@ -837,7 +837,7 @@ function expectsError(stackStartFn, actual, error, message) {
expected: error,
operator: stackStartFn.name,
message: `Missing expected ${fnType}${details}`,
stackStartFn
stackStartFn,
});
}

Expand Down Expand Up @@ -886,7 +886,7 @@ function expectsNoError(stackStartFn, actual, error, message) {
operator: stackStartFn.name,
message: `Got unwanted ${fnType}${details}\n` +
`Actual message: "${actual && actual.message}"`,
stackStartFn
stackStartFn,
});
}
throw actual;
Expand Down Expand Up @@ -955,7 +955,7 @@ assert.ifError = function ifError(err) {
expected: null,
operator: 'ifError',
message,
stackStartFn: ifError
stackStartFn: ifError,
});

// Make sure we actually have a stack trace!
Expand Down Expand Up @@ -1020,7 +1020,7 @@ function internalMatch(string, regexp, message, fn) {
expected: regexp,
message,
operator: fn.name,
stackStartFn: fn
stackStartFn: fn,
});
err.generatedMessage = generatedMessage;
throw err;
Expand Down Expand Up @@ -1064,7 +1064,7 @@ assert.strict = ObjectAssign(strict, assert, {
equal: assert.strictEqual,
deepEqual: assert.deepStrictEqual,
notEqual: assert.notStrictEqual,
notDeepEqual: assert.notDeepStrictEqual
notDeepEqual: assert.notDeepStrictEqual,
});

assert.strict.strict = assert.strict;
8 changes: 4 additions & 4 deletions lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {
const {
ERR_ASYNC_CALLBACK,
ERR_ASYNC_TYPE,
ERR_INVALID_ASYNC_ID
ERR_INVALID_ASYNC_ID,
} = require('internal/errors').codes;
const {
deprecate,
Expand Down Expand Up @@ -61,7 +61,7 @@ const {
const {
async_id_symbol, trigger_async_id_symbol,
init_symbol, before_symbol, after_symbol, destroy_symbol,
promise_resolve_symbol
promise_resolve_symbol,
} = internal_async_hooks.symbols;

// Get constants
Expand Down Expand Up @@ -259,7 +259,7 @@ class AsyncResource {
set: deprecate(function(val) {
self = val;
}, 'The asyncResource property on bound functions is deprecated', 'DEP0172'),
}
},
});
return bound;
}
Expand All @@ -278,7 +278,7 @@ const storageHook = createHook({
for (let i = 0; i < storageList.length; ++i) {
storageList[i]._propagate(resource, currentResource, type);
}
}
},
});

class AsyncLocalStorage {
Expand Down
Loading

0 comments on commit 9dbb162

Please sign in to comment.