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: https://github.com/nodejs/node/pull/5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
This commit is contained in:
Rich Trott authored and Rod Vagg committed 2016-02-27 17:15:29 +11:00
1 parent 365cc63783
commit fa5d28f246
4 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var doesNotExist = __filename + '__this_should_not_exist';
var doesNotExist = path.join(common.tmpDir, '__this_should_not_exist');
var readOnlyFile = path.join(common.tmpDir, 'read_only_file');
var readWriteFile = path.join(common.tmpDir, 'read_write_file');
+1 -1
View File
@@ -68,7 +68,7 @@ fs.open('.', 'r', undefined, function(err, fd) {
fs.close(fd);
});
console.log('stating: ' + __filename);
console.log(`stating: ${__filename}`);
fs.stat(__filename, function(err, s) {
if (err) {
got_error = true;
+1 -1
View File
@@ -18,7 +18,7 @@ if (process.argv[2] === 'child') {
}
// Run the script in a shell but close stdout and stderr.
var cmd = '"' + process.execPath + '" "' + __filename + '" child 1>&- 2>&-';
var cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`;
var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' });
proc.on('exit', common.mustCall(function(exitCode) {