From 4c2445a9683f427b05abadb47639979e33f295cb Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Fri, 29 May 2015 13:03:25 +0200 Subject: [PATCH] disable no-undef for tests --- .eslintrc | 9 ++++++--- test/.eslintrc | 4 +++- test/message/nexttick_throw.js | 1 - test/message/timeout_throw.js | 1 - test/parallel/test-domain-crypto.js | 2 +- test/parallel/test-domain-exit-dispose-again.js | 1 - test/parallel/test-domain-exit-dispose.js | 1 - test/parallel/test-exception-handler2.js | 1 - test/parallel/test-global.js | 2 +- test/parallel/test-http-exceptions.js | 1 - test/parallel/test-next-tick-errors.js | 1 - test/parallel/test-repl.js | 2 +- test/parallel/test-util-inspect.js | 1 - test/parallel/test-vm-new-script-new-context.js | 2 +- test/parallel/test-vm-new-script-this-context.js | 2 +- test/parallel/test-vm-run-in-new-context.js | 2 +- test/parallel/test-vm-static-this.js | 2 +- 17 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.eslintrc b/.eslintrc index 531d8908579c38..240e100f972f1e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -27,8 +27,6 @@ rules: no-unreachable: 2 ## require valid typeof compared string like typeof foo === 'strnig' valid-typeof: 2 - ## disallow use of undefined variables (globals) - no-undef: 2 # Best Practices # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices @@ -64,6 +62,11 @@ rules: ## 'use strict' on top strict: [2, "global"] + # Variables + # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables + ## disallow use of undefined variables (globals) + no-undef: 2 + # Global scoped method and vars globals: DTRACE_HTTP_CLIENT_REQUEST: false @@ -104,4 +107,4 @@ globals: root: false setImmediate: false setInterval: false - setTimeout: false \ No newline at end of file + setTimeout: false diff --git a/test/.eslintrc b/test/.eslintrc index 13833b9e79fbf9..0bfb0f5877bdc6 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -3,6 +3,8 @@ rules: ## allow unreachable code no-unreachable: 0 + ## allow undeclared variables + no-undef: 0 globals: - gc: false \ No newline at end of file + gc: false diff --git a/test/message/nexttick_throw.js b/test/message/nexttick_throw.js index d91941733fa935..3c0e2d8e379fd9 100644 --- a/test/message/nexttick_throw.js +++ b/test/message/nexttick_throw.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/message/timeout_throw.js b/test/message/timeout_throw.js index 5ee0202b935346..aaf3fbc8d2f48f 100644 --- a/test/message/timeout_throw.js +++ b/test/message/timeout_throw.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index eef1a4f9a6415d..96047474956e73 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ try { var crypto = require('crypto'); } catch (e) { diff --git a/test/parallel/test-domain-exit-dispose-again.js b/test/parallel/test-domain-exit-dispose-again.js index 012b5bb67e8271..d7046481d112ea 100644 --- a/test/parallel/test-domain-exit-dispose-again.js +++ b/test/parallel/test-domain-exit-dispose-again.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index 2cd74431e005c1..90e7210ce21aea 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-exception-handler2.js b/test/parallel/test-exception-handler2.js index c4dc8be0febe45..58e84ad21ba4ee 100644 --- a/test/parallel/test-exception-handler2.js +++ b/test/parallel/test-exception-handler2.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index d4a2b35dad5fb6..82d8ee054c5860 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-exceptions.js b/test/parallel/test-http-exceptions.js index 84a06ce82a1757..dc2d5583ddbaf9 100644 --- a/test/parallel/test-http-exceptions.js +++ b/test/parallel/test-http-exceptions.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index aed706ae478719..eccd7a43a0825f 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 03dc906ada8bd3..6911c591505fef 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -1,4 +1,4 @@ -/* eslint-disable max-len, strict, no-undef */ +/* eslint-disable max-len, strict */ var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 15cbf27d2e9d16..f583005ce96f75 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ 'use strict'; var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js index 6884ddb339507b..4619c9345c5e5c 100644 --- a/test/parallel/test-vm-new-script-new-context.js +++ b/test/parallel/test-vm-new-script-new-context.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ var common = require('../common'); var assert = require('assert'); var Script = require('vm').Script; diff --git a/test/parallel/test-vm-new-script-this-context.js b/test/parallel/test-vm-new-script-this-context.js index 6707480cfe7f7e..16d8acd1ca6700 100644 --- a/test/parallel/test-vm-new-script-this-context.js +++ b/test/parallel/test-vm-new-script-this-context.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ var common = require('../common'); var assert = require('assert'); var Script = require('vm').Script; diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js index 2b794bf72ea940..da14a041face31 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ // Flags: --expose-gc var common = require('../common'); diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index 3647a0d72ced7d..fb9cb764f8422c 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -1,4 +1,4 @@ -/* eslint-disable strict, no-undef */ +/* eslint-disable strict */ var common = require('../common'); var assert = require('assert'); var vm = require('vm');