mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Fix no-invalid-this issues (#9207)
See [`no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) for more information. This change enables `no-invalid-this` and fixes the issues raised by the rule.
This commit is contained in:
parent
c0f05ccae6
commit
cd370be728
13
.eslintrc.js
13
.eslintrc.js
@ -105,6 +105,10 @@ module.exports = {
|
||||
'logical': 'parens-new-line',
|
||||
'prop': 'parens-new-line',
|
||||
}],
|
||||
|
||||
'no-invalid-this': 'off',
|
||||
'babel/no-invalid-this': 'error',
|
||||
|
||||
'babel/semi': ['error', 'never'],
|
||||
'mocha/no-setup-in-describe': 'off',
|
||||
},
|
||||
@ -124,6 +128,15 @@ module.exports = {
|
||||
rules: {
|
||||
'global-require': 'off',
|
||||
},
|
||||
}, {
|
||||
files: [
|
||||
'test/**/*-test.js',
|
||||
'test/**/*.spec.js',
|
||||
],
|
||||
rules: {
|
||||
// Mocha will re-assign `this` in a test context
|
||||
'babel/no-invalid-this': 'off',
|
||||
},
|
||||
}],
|
||||
|
||||
settings: {
|
||||
|
@ -164,10 +164,10 @@ export default class TransactionStateManager extends EventEmitter {
|
||||
txMeta.txParams = this.normalizeAndValidateTxParams(txMeta.txParams)
|
||||
}
|
||||
|
||||
this.once(`${txMeta.id}:signed`, function () {
|
||||
this.once(`${txMeta.id}:signed`, () => {
|
||||
this.removeAllListeners(`${txMeta.id}:rejected`)
|
||||
})
|
||||
this.once(`${txMeta.id}:rejected`, function () {
|
||||
this.once(`${txMeta.id}:rejected`, () => {
|
||||
this.removeAllListeners(`${txMeta.id}:signed`)
|
||||
})
|
||||
// initialize history
|
||||
|
@ -124,6 +124,7 @@ export function setTickPosition (axis, n, newPosition, secondNewPosition) {
|
||||
.style('visibility', 'visible')
|
||||
}
|
||||
|
||||
/* eslint-disable babel/no-invalid-this */
|
||||
export function appendOrUpdateCircle ({ data, itemIndex, cx, cy, cssId, appendOnly }) {
|
||||
const circle = this.main
|
||||
.select('.c3-selected-circles' + this.getTargetSelectorSuffix(data.id))
|
||||
@ -144,6 +145,7 @@ export function appendOrUpdateCircle ({ data, itemIndex, cx, cy, cssId, appendOn
|
||||
.attr('cy', cy)
|
||||
}
|
||||
}
|
||||
/* eslint-enable babel/no-invalid-this */
|
||||
|
||||
export function setSelectedCircle ({
|
||||
chart,
|
||||
|
Loading…
Reference in New Issue
Block a user