mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Enable indent linting via ESLint (#6936)
* Enable indent linting via ESLint * yarn run lint:fix
This commit is contained in:
parent
e9c7df28ed
commit
4d88e1cf86
@ -59,7 +59,7 @@
|
|||||||
"eqeqeq": [2, "allow-null"],
|
"eqeqeq": [2, "allow-null"],
|
||||||
"generator-star-spacing": [2, { "before": true, "after": true }],
|
"generator-star-spacing": [2, { "before": true, "after": true }],
|
||||||
"handle-callback-err": [2, "^(err|error)$" ],
|
"handle-callback-err": [2, "^(err|error)$" ],
|
||||||
"indent": "off",
|
"indent": [2, 2,{ "SwitchCase": 1 }],
|
||||||
"jsx-quotes": [2, "prefer-double"],
|
"jsx-quotes": [2, "prefer-double"],
|
||||||
"key-spacing": 2,
|
"key-spacing": 2,
|
||||||
"keyword-spacing": [2, { "before": true, "after": true }],
|
"keyword-spacing": [2, { "before": true, "after": true }],
|
||||||
|
@ -68,7 +68,7 @@ class PreferencesController {
|
|||||||
return this.setFeatureFlag(key, value)
|
return this.setFeatureFlag(key, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// PUBLIC METHODS
|
// PUBLIC METHODS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@code forgottenPassword} state property
|
* Sets the {@code forgottenPassword} state property
|
||||||
|
@ -129,7 +129,7 @@ class TransactionController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adds a tx to the txlist
|
Adds a tx to the txlist
|
||||||
@emits ${txMeta.id}:unapproved
|
@emits ${txMeta.id}:unapproved
|
||||||
*/
|
*/
|
||||||
@ -220,7 +220,7 @@ class TransactionController extends EventEmitter {
|
|||||||
|
|
||||||
return txMeta
|
return txMeta
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
adds the tx gas defaults: gas && gasPrice
|
adds the tx gas defaults: gas && gasPrice
|
||||||
@param txMeta {Object} - the txMeta object
|
@param txMeta {Object} - the txMeta object
|
||||||
@returns {Promise<object>} resolves with txMeta
|
@returns {Promise<object>} resolves with txMeta
|
||||||
@ -495,9 +495,9 @@ class TransactionController extends EventEmitter {
|
|||||||
this.txStateManager.updateTx(txMeta, 'transactions#setTxHash')
|
this.txStateManager.updateTx(txMeta, 'transactions#setTxHash')
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// PRIVATE METHODS
|
// PRIVATE METHODS
|
||||||
//
|
//
|
||||||
/** maps methods for convenience*/
|
/** maps methods for convenience*/
|
||||||
_mapMethods () {
|
_mapMethods () {
|
||||||
/** @returns the state in transaction controller */
|
/** @returns the state in transaction controller */
|
||||||
|
@ -26,7 +26,7 @@ const normalizers = {
|
|||||||
gasPrice: gasPrice => addHexPrefix(gasPrice),
|
gasPrice: gasPrice => addHexPrefix(gasPrice),
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
normalizes txParams
|
normalizes txParams
|
||||||
@param txParams {object}
|
@param txParams {object}
|
||||||
@returns {object} normalized txParams
|
@returns {object} normalized txParams
|
||||||
@ -40,7 +40,7 @@ function normalizeTxParams (txParams, LowerCase) {
|
|||||||
return normalizedTxParams
|
return normalizedTxParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
validates txParams
|
validates txParams
|
||||||
@param txParams {object}
|
@param txParams {object}
|
||||||
*/
|
*/
|
||||||
@ -59,7 +59,7 @@ function validateTxParams (txParams) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
validates the from field in txParams
|
validates the from field in txParams
|
||||||
@param txParams {object}
|
@param txParams {object}
|
||||||
*/
|
*/
|
||||||
@ -68,7 +68,7 @@ function validateFrom (txParams) {
|
|||||||
if (!isValidAddress(txParams.from)) throw new Error('Invalid from address')
|
if (!isValidAddress(txParams.from)) throw new Error('Invalid from address')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
validates the to field in txParams
|
validates the to field in txParams
|
||||||
@param txParams {object}
|
@param txParams {object}
|
||||||
*/
|
*/
|
||||||
@ -85,7 +85,7 @@ function validateRecipient (txParams) {
|
|||||||
return txParams
|
return txParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@returns an {array} of states that can be considered final
|
@returns an {array} of states that can be considered final
|
||||||
*/
|
*/
|
||||||
function getFinalStates () {
|
function getFinalStates () {
|
||||||
|
@ -245,7 +245,7 @@ class TransactionStateManager extends EventEmitter {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param opts {object} - an object of fields to search for eg:<br>
|
@param opts {object} - an object of fields to search for eg:<br>
|
||||||
let <code>thingsToLookFor = {<br>
|
let <code>thingsToLookFor = {<br>
|
||||||
to: '0x0..',<br>
|
to: '0x0..',<br>
|
||||||
@ -403,9 +403,9 @@ class TransactionStateManager extends EventEmitter {
|
|||||||
// Update state
|
// Update state
|
||||||
this._saveTxList(otherAccountTxs)
|
this._saveTxList(otherAccountTxs)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// PRIVATE METHODS
|
// PRIVATE METHODS
|
||||||
//
|
//
|
||||||
|
|
||||||
// STATUS METHODS
|
// STATUS METHODS
|
||||||
// statuses:
|
// statuses:
|
||||||
|
@ -362,9 +362,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
return publicConfigStore
|
return publicConfigStore
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// EXPOSED TO THE UI SUBSYSTEM
|
// EXPOSED TO THE UI SUBSYSTEM
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metamask-state of the various controllers, made available to the UI
|
* The metamask-state of the various controllers, made available to the UI
|
||||||
@ -503,9 +503,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// VAULT / KEYRING RELATED METHODS
|
// VAULT / KEYRING RELATED METHODS
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Vault and create a new keychain.
|
* Creates a new Vault and create a new keychain.
|
||||||
@ -1185,9 +1185,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// END (VAULT / KEYRING RELATED METHODS)
|
// END (VAULT / KEYRING RELATED METHODS)
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a user to try to speed up a transaction by retrying it
|
* Allows a user to try to speed up a transaction by retrying it
|
||||||
@ -1236,9 +1236,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// PASSWORD MANAGEMENT
|
// PASSWORD MANAGEMENT
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a user to begin the seed phrase recovery process.
|
* Allows a user to begin the seed phrase recovery process.
|
||||||
@ -1260,9 +1260,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
cb()
|
cb()
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// SETUP
|
// SETUP
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to create a multiplexed stream for connecting to an untrusted context
|
* Used to create a multiplexed stream for connecting to an untrusted context
|
||||||
@ -1557,9 +1557,9 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
return pendingNonce
|
return pendingNonce
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// CONFIG
|
// CONFIG
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
// Log blocks
|
// Log blocks
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
const version = 31
|
const version = 31
|
||||||
const clone = require('clone')
|
const clone = require('clone')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The purpose of this migration is to properly set the completedOnboarding flag baesd on the state
|
* The purpose of this migration is to properly set the completedOnboarding flag baesd on the state
|
||||||
* of the KeyringController.
|
* of the KeyringController.
|
||||||
*/
|
*/
|
||||||
@ -19,7 +19,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformState (state) {
|
function transformState (state) {
|
||||||
const { KeyringController, PreferencesController } = state
|
const { KeyringController, PreferencesController } = state
|
||||||
|
|
||||||
if (KeyringController && PreferencesController) {
|
if (KeyringController && PreferencesController) {
|
||||||
|
@ -205,7 +205,7 @@ function generateContainerTest (sPath, {
|
|||||||
mapDispatchToPropsMethodNames,
|
mapDispatchToPropsMethodNames,
|
||||||
proxyquireObject,
|
proxyquireObject,
|
||||||
}) {
|
}) {
|
||||||
return `import assert from 'assert'
|
return `import assert from 'assert'
|
||||||
import proxyquire from 'proxyquire'
|
import proxyquire from 'proxyquire'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
|
|
||||||
|
@ -362,4 +362,4 @@ describe('Using MetaMask with an existing account', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const migration31 = require('../../../app/scripts/migrations/031')
|
const migration31 = require('../../../app/scripts/migrations/031')
|
||||||
|
|
||||||
describe('migration #31', () => {
|
describe('migration #31', () => {
|
||||||
it('should set completedOnboarding to true if vault exists', done => {
|
it('should set completedOnboarding to true if vault exists', done => {
|
||||||
const oldStorage = {
|
const oldStorage = {
|
||||||
'meta': {},
|
'meta': {},
|
||||||
|
@ -30,5 +30,5 @@ web3.currentProvider.enable().then(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ export default class AdvancedTab extends PureComponent {
|
|||||||
renderMobileSync () {
|
renderMobileSync () {
|
||||||
const { t } = this.context
|
const { t } = this.context
|
||||||
const { history } = this.props
|
const { history } = this.props
|
||||||
//
|
//
|
||||||
return (
|
return (
|
||||||
<div className="settings-page__content-row">
|
<div className="settings-page__content-row">
|
||||||
<div className="settings-page__content-item">
|
<div className="settings-page__content-item">
|
||||||
|
@ -274,12 +274,12 @@ var actions = {
|
|||||||
showSubLoadingIndication: showSubLoadingIndication,
|
showSubLoadingIndication: showSubLoadingIndication,
|
||||||
HIDE_SUB_LOADING_INDICATION: 'HIDE_SUB_LOADING_INDICATION',
|
HIDE_SUB_LOADING_INDICATION: 'HIDE_SUB_LOADING_INDICATION',
|
||||||
hideSubLoadingIndication: hideSubLoadingIndication,
|
hideSubLoadingIndication: hideSubLoadingIndication,
|
||||||
// QR STUFF:
|
// QR STUFF:
|
||||||
SHOW_QR: 'SHOW_QR',
|
SHOW_QR: 'SHOW_QR',
|
||||||
showQrView: showQrView,
|
showQrView: showQrView,
|
||||||
reshowQrCode: reshowQrCode,
|
reshowQrCode: reshowQrCode,
|
||||||
SHOW_QR_VIEW: 'SHOW_QR_VIEW',
|
SHOW_QR_VIEW: 'SHOW_QR_VIEW',
|
||||||
// FORGOT PASSWORD:
|
// FORGOT PASSWORD:
|
||||||
BACK_TO_INIT_MENU: 'BACK_TO_INIT_MENU',
|
BACK_TO_INIT_MENU: 'BACK_TO_INIT_MENU',
|
||||||
goBackToInitView: goBackToInitView,
|
goBackToInitView: goBackToInitView,
|
||||||
RECOVERY_IN_PROGRESS: 'RECOVERY_IN_PROGRESS',
|
RECOVERY_IN_PROGRESS: 'RECOVERY_IN_PROGRESS',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user