mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix array-callback-return issues
See [`array-callback-return`](https://eslint.org/docs/rules/array-callback-return) for more information. This change enables `array-callback-return` and fixes the issues raised by the rule.
This commit is contained in:
parent
549eb320e8
commit
983e32274c
@ -41,6 +41,9 @@ module.exports = {
|
||||
},
|
||||
|
||||
rules: {
|
||||
/* TODO: Remove these when upgrading to `@metamask/eslint-config@2` */
|
||||
'array-callback-return': 'error',
|
||||
/* End v2 rules */
|
||||
'arrow-parens': 'error',
|
||||
'no-tabs': 'error',
|
||||
'no-mixed-operators': 'error',
|
||||
|
@ -47,7 +47,7 @@ function displayChart (data) {
|
||||
console.log(`\nbuild completed. task timeline:`)
|
||||
|
||||
// build bars for bounds
|
||||
data.map((entry, index) => {
|
||||
data.forEach((entry, index) => {
|
||||
const [label, start, end] = entry
|
||||
const [start2, end2] = [start, end].map((value) => adjust(value, first, last, 40))
|
||||
const barString = barBuilder(start2, end2)
|
||||
|
@ -67,7 +67,7 @@ export default class ContactList extends PureComponent {
|
||||
return 1
|
||||
} else if (letter1 === letter2) {
|
||||
return 0
|
||||
} else if (letter1 < letter2) {
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
})
|
||||
|
@ -128,7 +128,7 @@ describe('SendFooter Component', function () {
|
||||
},
|
||||
|
||||
}
|
||||
Object.entries(config).map(([description, obj]) => {
|
||||
Object.entries(config).forEach(([description, obj]) => {
|
||||
it(description, function () {
|
||||
wrapper.setProps(obj)
|
||||
assert.equal(wrapper.instance().formShouldBeDisabled(), obj.expectedResult)
|
||||
|
@ -103,7 +103,7 @@ describe('send utils', function () {
|
||||
expectedResult: false,
|
||||
},
|
||||
}
|
||||
Object.entries(config).map(([description, obj]) => {
|
||||
Object.entries(config).forEach(([description, obj]) => {
|
||||
it(description, function () {
|
||||
assert.equal(doesAmountErrorRequireUpdate(obj), obj.expectedResult)
|
||||
})
|
||||
@ -166,7 +166,7 @@ describe('send utils', function () {
|
||||
expectedResult: { amount: INSUFFICIENT_TOKENS_ERROR },
|
||||
},
|
||||
}
|
||||
Object.entries(config).map(([description, obj]) => {
|
||||
Object.entries(config).forEach(([description, obj]) => {
|
||||
it(description, function () {
|
||||
assert.deepEqual(getAmountErrorObject(obj), obj.expectedResult)
|
||||
})
|
||||
@ -190,7 +190,7 @@ describe('send utils', function () {
|
||||
expectedResult: { gasFee: null },
|
||||
},
|
||||
}
|
||||
Object.entries(config).map(([description, obj]) => {
|
||||
Object.entries(config).forEach(([description, obj]) => {
|
||||
it(description, function () {
|
||||
assert.deepEqual(getGasFeeErrorObject(obj), obj.expectedResult)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user