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: add Node.js-specific ESLint rules #5320

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
18 changes: 12 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ rules:
no-octal: 2
no-redeclare: 2

# Variables
# http://eslint.org/docs/rules/#variables
no-delete-var: 2
no-undef: 2
no-unused-vars: [2, {"args": "none"}]

# Node.js and CommonJS
# http://eslint.org/docs/rules/#nodejs-and-commonjs
no-mixed-requires: 2
no-new-require: 2
no-restricted-modules: [2, "sys", "_linklist"]

# Stylistic Issues
# https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
comma-spacing: 2
Expand Down Expand Up @@ -66,12 +78,6 @@ rules:
# https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
strict: [2, "global"]

# Variables
# https://github.com/eslint/eslint/tree/master/docs/rules#variables
no-delete-var: 2
no-undef: 2
no-unused-vars: [2, {"args": "none"}]

# Custom rules in tools/eslint-rules
require-buffer: 2
new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"]
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-sys.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
require('../common');
var assert = require('assert');
var sys = require('sys');
var sys = require('sys'); // eslint-disable-line no-restricted-modules
var util = require('util');

assert.strictEqual(sys, util);
2 changes: 1 addition & 1 deletion test/parallel/test-timers-linked-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require('../common');
const assert = require('assert');
const L = require('_linklist');
const L = require('_linklist'); // eslint-disable-line no-restricted-modules
const internalL = require('internal/linkedlist');

assert.strictEqual(L, internalL);
Expand Down