From 853b89e314451f8d4aa8b24b86b2cad49c1f7062 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 12 Aug 2020 21:21:54 -0230 Subject: [PATCH] Fix no-global-assign issues (#9209) See [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign) for more information. This change enables `no-global-assign` and fixes the issues raised by the rule. --- .eslintrc.js | 1 + test/unit-global/frozenPromise.js | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 69f596075..4f366fbf6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -51,6 +51,7 @@ module.exports = { 'no-case-declarations': 'error', 'no-empty': 'error', 'no-eq-null': 'error', + 'no-global-assign': 'error', 'no-loop-func': 'error', 'no-plusplus': ['error', { 'allowForLoopAfterthoughts': true }], 'no-useless-catch': 'error', diff --git a/test/unit-global/frozenPromise.js b/test/unit-global/frozenPromise.js index 05f1defe7..74da3b01b 100644 --- a/test/unit-global/frozenPromise.js +++ b/test/unit-global/frozenPromise.js @@ -1,7 +1,3 @@ - -/* eslint-disable no-native-reassign */ - -// this is what we're testing import '../../app/scripts/lib/freezeGlobals' import assert from 'assert' @@ -10,6 +6,7 @@ describe('Promise global is immutable', function () { it('throws when reassinging promise (syntax 1)', function () { try { + // eslint-disable-next-line no-global-assign,no-native-reassign Promise = {} assert.fail('did not throw error') } catch (err) {