mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
tools: enable no-var ESLint rule for lib
PR-URL: https://github.com/nodejs/node/pull/42573 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
1 parent
49547abe99
commit
b07894d8dc
7 files changed
+4
-4
No files matched your search
@@ -260,6 +260,7 @@ module.exports = {
|
||||
'no-useless-concat': 'error',
|
||||
'no-useless-constructor': 'error',
|
||||
'no-useless-return': 'error',
|
||||
'no-var': 'error',
|
||||
'no-void': 'error',
|
||||
'no-whitespace-before-property': 'error',
|
||||
'object-curly-newline': 'error',
|
||||
|
||||
@@ -5,5 +5,4 @@ env:
|
||||
es6: true
|
||||
|
||||
rules:
|
||||
no-var: error
|
||||
prefer-arrow-callback: error
|
||||
@@ -9,7 +9,6 @@ rules:
|
||||
symbol-description: off
|
||||
|
||||
# Add new ECMAScript features gradually
|
||||
no-var: error
|
||||
prefer-const: error
|
||||
prefer-rest-params: error
|
||||
prefer-template: error
|
||||
|
||||
@@ -196,6 +196,7 @@ function emitInitNative(asyncId, type, triggerAsyncId, resource) {
|
||||
try {
|
||||
// Using var here instead of let because "for (var ...)" is faster than let.
|
||||
// Refs: https://github.com/nodejs/node/pull/30380#issuecomment-552948364
|
||||
// eslint-disable-next-line no-var
|
||||
for (var i = 0; i < active_hooks.array.length; i++) {
|
||||
if (typeof active_hooks.array[i][init_symbol] === 'function') {
|
||||
active_hooks.array[i][init_symbol](
|
||||
@@ -228,6 +229,7 @@ function emitHook(symbol, asyncId) {
|
||||
try {
|
||||
// Using var here instead of let because "for (var ...)" is faster than let.
|
||||
// Refs: https://github.com/nodejs/node/pull/30380#issuecomment-552948364
|
||||
// eslint-disable-next-line no-var
|
||||
for (var i = 0; i < active_hooks.array.length; i++) {
|
||||
if (typeof active_hooks.array[i][symbol] === 'function') {
|
||||
active_hooks.array[i][symbol](asyncId);
|
||||
|
||||
@@ -171,6 +171,7 @@ class JSStreamSocket extends Socket {
|
||||
|
||||
this.stream.cork();
|
||||
// Use `var` over `let` for performance optimization.
|
||||
// eslint-disable-next-line no-var
|
||||
for (var i = 0; i < bufs.length; ++i)
|
||||
this.stream.write(bufs[i], done);
|
||||
this.stream.uncork();
|
||||
|
||||
@@ -6,7 +6,6 @@ env:
|
||||
|
||||
rules:
|
||||
multiline-comment-style: [error, separate-lines]
|
||||
no-var: error
|
||||
prefer-const: error
|
||||
symbol-description: off
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ rules:
|
||||
- error
|
||||
- args: after-used
|
||||
prefer-arrow-callback: error
|
||||
no-var: error
|
||||
Reference in new issue
Block a user