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: enforce arrow function brace usage linting #6455

Closed
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ rules:

# ECMAScript 6
# http://eslint.org/docs/rules/#ecmascript-6
arrow-body-style: 2
arrow-parens: [2, "always"]
arrow-spacing: [2, {"before": true, "after": true}]
constructor-super: 2
Expand Down
5 changes: 2 additions & 3 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,8 @@ function Server(options, connectionListener) {
return this._connections;
}, 'Server.connections property is deprecated. ' +
'Use Server.getConnections method instead.'),
set: internalUtil.deprecate((val) => {
return (this._connections = val);
}, 'Server.connections property is deprecated.'),
set: internalUtil.deprecate((val) => (this._connections = val),
'Server.connections property is deprecated.'),
configurable: true, enumerable: false
});

Expand Down
4 changes: 1 addition & 3 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,7 @@ REPLServer.prototype.createContext = function() {

Object.defineProperty(context, '_', {
configurable: true,
get: () => {
return this.last;
},
get: () => this.last,
set: (value) => {
this.last = value;
if (!this.underscoreAssigned) {
Expand Down
4 changes: 1 addition & 3 deletions test/parallel/test-fs-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ assert.throws(() => {
const dir = Buffer.from(common.fixturesDir);
fs.readdir(dir, 'hex', common.mustCall((err, list) => {
if (err) throw err;
list = list.map((i) => {
return Buffer.from(i, 'hex').toString();
});
list = list.map((i) => Buffer.from(i, 'hex').toString());
fs.readdir(dir, common.mustCall((err, list2) => {
if (err) throw err;
assert.deepStrictEqual(list, list2);
Expand Down
7 changes: 4 additions & 3 deletions test/parallel/test-module-loading-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ if (!dlerror_msg) {
try {
require('../fixtures/module-loading-error.node');
} catch (e) {
assert.strictEqual(dlerror_msg.some((errMsgCase) => {
return e.toString().indexOf(errMsgCase) !== -1;
}), true);
assert.strictEqual(
dlerror_msg.some((errMsgCase) => e.toString().includes(errMsgCase)),
true
);
}

try {
Expand Down
2 changes: 1 addition & 1 deletion tools/eslint-rules/align-function-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function checkArgumentAlignment(context, node) {
// For now, don't bother trying to validate potentially complicating things
// like closures. Different people will have very different ideas and it's
// probably best to implement configuration options.
if (args.some((node) => { return ignoreTypes.indexOf(node.type) !== -1; })) {
if (args.some((node) => ignoreTypes.indexOf(node.type) !== -1)) {
return;
}

Expand Down