mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
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.
This commit is contained in:
parent
438bb954ef
commit
853b89e314
@ -51,6 +51,7 @@ module.exports = {
|
|||||||
'no-case-declarations': 'error',
|
'no-case-declarations': 'error',
|
||||||
'no-empty': 'error',
|
'no-empty': 'error',
|
||||||
'no-eq-null': 'error',
|
'no-eq-null': 'error',
|
||||||
|
'no-global-assign': 'error',
|
||||||
'no-loop-func': 'error',
|
'no-loop-func': 'error',
|
||||||
'no-plusplus': ['error', { 'allowForLoopAfterthoughts': true }],
|
'no-plusplus': ['error', { 'allowForLoopAfterthoughts': true }],
|
||||||
'no-useless-catch': 'error',
|
'no-useless-catch': 'error',
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
|
|
||||||
/* eslint-disable no-native-reassign */
|
|
||||||
|
|
||||||
// this is what we're testing
|
|
||||||
import '../../app/scripts/lib/freezeGlobals'
|
import '../../app/scripts/lib/freezeGlobals'
|
||||||
|
|
||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
@ -10,6 +6,7 @@ describe('Promise global is immutable', function () {
|
|||||||
|
|
||||||
it('throws when reassinging promise (syntax 1)', function () {
|
it('throws when reassinging promise (syntax 1)', function () {
|
||||||
try {
|
try {
|
||||||
|
// eslint-disable-next-line no-global-assign,no-native-reassign
|
||||||
Promise = {}
|
Promise = {}
|
||||||
assert.fail('did not throw error')
|
assert.fail('did not throw error')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user