Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9534f6d

Browse filesBrowse files
committed
tools: enable additional lint rules
Enable additional likely-uncontroversial lint rules: * `comma-dangle` set to prohibit dangling commas on objects and arrays that are defined on a single line. Multi-line definitions can use or omit a trailing comma. * `no-unused-labels` Prohibits defining a label that is not used. * `no-path-concat` Prohibits string-concatenation using i`__dirname` and `__filename`. Use `path.join()`, `path.resolve()`, or template strings instead. * `no-new-symbol` disallow use of `new` operator with `Symbol` object. Violating this rule would result in a `TypeError` at runtime.` PR-URL: #5357 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
1 parent 7b0a83d commit 9534f6d
Copy full SHA for 9534f6d

File tree

Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed
Open diff view settings
Collapse file

‎.eslintrc‎

Copy file name to clipboardExpand all lines: .eslintrc
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ env:
55
rules:
66
# Possible Errors
77
# https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
8+
comma-dangle: [2, "only-multiline"]
89
no-control-regex: 2
910
no-debugger: 2
1011
no-dupe-args: 2
@@ -30,6 +31,7 @@ rules:
3031
no-fallthrough: 2
3132
no-octal: 2
3233
no-redeclare: 2
34+
no-unused-labels: 2
3335

3436
# Variables
3537
# http://eslint.org/docs/rules/#variables
@@ -41,6 +43,7 @@ rules:
4143
# http://eslint.org/docs/rules/#nodejs-and-commonjs
4244
no-mixed-requires: 2
4345
no-new-require: 2
46+
no-path-concat: 2
4447
no-restricted-modules: [2, "sys", "_linklist"]
4548

4649
# Stylistic Issues
@@ -71,6 +74,7 @@ rules:
7174
no-confusing-arrow: 2
7275
no-const-assign: 2
7376
no-dupe-class-members: 2
77+
no-new-symbol: 2
7478
no-this-before-super: 2
7579
prefer-const: 2
7680

Collapse file

‎test/parallel/test-fs-access.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-access.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var common = require('../common');
33
var assert = require('assert');
44
var fs = require('fs');
55
var path = require('path');
6-
var doesNotExist = __filename + '__this_should_not_exist';
6+
var doesNotExist = path.join(common.tmpDir, '__this_should_not_exist');
77
var readOnlyFile = path.join(common.tmpDir, 'read_only_file');
88
var readWriteFile = path.join(common.tmpDir, 'read_write_file');
99

Collapse file

‎test/parallel/test-fs-stat.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-stat.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fs.open('.', 'r', undefined, function(err, fd) {
6868
fs.close(fd);
6969
});
7070

71-
console.log('stating: ' + __filename);
71+
console.log(`stating: ${__filename}`);
7272
fs.stat(__filename, function(err, s) {
7373
if (err) {
7474
got_error = true;
Collapse file

‎test/parallel/test-stdio-closed.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stdio-closed.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (process.argv[2] === 'child') {
1818
}
1919

2020
// Run the script in a shell but close stdout and stderr.
21-
var cmd = '"' + process.execPath + '" "' + __filename + '" child 1>&- 2>&-';
21+
var cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`;
2222
var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' });
2323

2424
proc.on('exit', common.mustCall(function(exitCode) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.