mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Fix import/extensions issues (#9217)
See [`import/extensions`](https://eslint.org/docs/rules/import/extensions) for more information. This change enables `import/extensions` and fixes the issues raised by the rule.
This commit is contained in:
parent
c188121c3d
commit
9b78d3ab07
@ -48,6 +48,7 @@ module.exports = {
|
||||
'global-require': 'error',
|
||||
'guard-for-in': 'error',
|
||||
'implicit-arrow-linebreak': 'error',
|
||||
'import/extensions': ['error', 'never', { 'json': 'always' }],
|
||||
'no-case-declarations': 'error',
|
||||
'no-constant-condition': 'error',
|
||||
'no-dupe-else-if': 'error',
|
||||
|
@ -26,7 +26,7 @@ import Migrator from './lib/migrator'
|
||||
import migrations from './migrations'
|
||||
import PortStream from 'extension-port-stream'
|
||||
import createStreamSink from './lib/createStreamSink'
|
||||
import NotificationManager from './lib/notification-manager.js'
|
||||
import NotificationManager from './lib/notification-manager'
|
||||
import MetamaskController from './metamask-controller'
|
||||
import rawFirstTimeState from './first-time-state'
|
||||
import setupSentry from './lib/setupSentry'
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
SEND_ETHER_ACTION_KEY,
|
||||
DEPLOY_CONTRACT_ACTION_KEY,
|
||||
CONTRACT_INTERACTION_KEY,
|
||||
} from '../../../../ui/app/helpers/constants/transactions.js'
|
||||
} from '../../../../ui/app/helpers/constants/transactions'
|
||||
|
||||
import TransactionStateManager from './tx-state-manager'
|
||||
import TxGasUtil from './tx-gas-utils'
|
||||
|
@ -35,7 +35,7 @@ import LocalMessageDuplexStream from 'post-message-stream'
|
||||
import { initProvider } from '@metamask/inpage-provider'
|
||||
|
||||
// TODO:deprecate:2020
|
||||
import setupWeb3 from './lib/setupWeb3.js'
|
||||
import setupWeb3 from './lib/setupWeb3'
|
||||
|
||||
restoreContextAfterImports()
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import urlUtil from 'url'
|
||||
import extension from 'extensionizer'
|
||||
import resolveEnsToIpfsContentId from './resolver.js'
|
||||
import resolveEnsToIpfsContentId from './resolver'
|
||||
|
||||
const supportedTopLevelDomains = ['eth']
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
// TODO:deprecate:2020
|
||||
// Delete this file
|
||||
|
||||
import 'web3/dist/web3.min.js'
|
||||
import 'web3/dist/web3.min'
|
||||
|
||||
const shouldLogUsage = !([
|
||||
'docs.metamask.io',
|
||||
|
@ -24,7 +24,7 @@ import createOriginMiddleware from './lib/createOriginMiddleware'
|
||||
import createTabIdMiddleware from './lib/createTabIdMiddleware'
|
||||
import createOnboardingMiddleware from './lib/createOnboardingMiddleware'
|
||||
import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware'
|
||||
import { setupMultiplex } from './lib/stream-utils.js'
|
||||
import { setupMultiplex } from './lib/stream-utils'
|
||||
import KeyringController from 'eth-keyring-controller'
|
||||
import EnsController from './controllers/ens'
|
||||
import NetworkController from './controllers/network'
|
||||
|
@ -3,7 +3,7 @@ import dnode from 'dnode'
|
||||
import { EventEmitter } from 'events'
|
||||
import PortStream from 'extension-port-stream'
|
||||
import extension from 'extensionizer'
|
||||
import { setupMultiplex } from './lib/stream-utils.js'
|
||||
import { setupMultiplex } from './lib/stream-utils'
|
||||
import { getEnvironmentType } from './lib/util'
|
||||
import ExtensionPlatform from './platforms/extension'
|
||||
|
||||
|
@ -24,7 +24,7 @@ import Eth from 'ethjs'
|
||||
import EthQuery from 'eth-query'
|
||||
import launchMetaMaskUi from '../../ui'
|
||||
import StreamProvider from 'web3-stream-provider'
|
||||
import { setupMultiplex } from './lib/stream-utils.js'
|
||||
import { setupMultiplex } from './lib/stream-utils'
|
||||
import log from 'loglevel'
|
||||
|
||||
start().catch(log.error)
|
||||
|
@ -13,7 +13,7 @@ import {
|
||||
SEND_ETHER_ACTION_KEY,
|
||||
DEPLOY_CONTRACT_ACTION_KEY,
|
||||
CONTRACT_INTERACTION_KEY,
|
||||
} from '../../../../../ui/app/helpers/constants/transactions.js'
|
||||
} from '../../../../../ui/app/helpers/constants/transactions'
|
||||
|
||||
import { createTestProviderTools, getTestAccounts } from '../../../../stub/provider'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import assert from 'assert'
|
||||
import migrationTemplate from '../../../app/scripts/migrations/030.js'
|
||||
import migrationTemplate from '../../../app/scripts/migrations/030'
|
||||
|
||||
const storage = {
|
||||
meta: {},
|
||||
|
@ -1 +1 @@
|
||||
export { default } from './asset-list.js'
|
||||
export { default } from './asset-list'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import ConfirmDetailRow from '../confirm-detail-row.component.js'
|
||||
import ConfirmDetailRow from '../confirm-detail-row.component'
|
||||
import sinon from 'sinon'
|
||||
|
||||
const propsMethodSpies = {
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import sinon from 'sinon'
|
||||
import { shallow } from 'enzyme'
|
||||
import { DropdownMenuItem } from '../components/dropdown.js'
|
||||
import { DropdownMenuItem } from '../components/dropdown'
|
||||
|
||||
describe('Dropdown', function () {
|
||||
let wrapper
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import shallow from '../../../../../../../lib/shallow-with-context'
|
||||
import sinon from 'sinon'
|
||||
import AdvancedTabContent from '../advanced-tab-content.component.js'
|
||||
import AdvancedTabContent from '../advanced-tab-content.component'
|
||||
|
||||
import GasPriceChart from '../../../gas-price-chart'
|
||||
import Loading from '../../../../../ui/loading-screen'
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import shallow from '../../../../../../lib/shallow-with-context'
|
||||
import sinon from 'sinon'
|
||||
import GasModalPageContainer from '../gas-modal-page-container.component.js'
|
||||
import GasModalPageContainer from '../gas-modal-page-container.component'
|
||||
import timeout from '../../../../../../lib/test-timeout'
|
||||
|
||||
import PageContainer from '../../../../ui/page-container'
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
hideDataUI,
|
||||
setTickPosition,
|
||||
handleMouseMove,
|
||||
} from './gas-price-chart.utils.js'
|
||||
} from './gas-price-chart.utils'
|
||||
|
||||
export default class GasPriceChart extends Component {
|
||||
static contextTypes = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import AccountModalContainer from '../account-modal-container'
|
||||
import genAccountLink from '../../../../../lib/account-link.js'
|
||||
import genAccountLink from '../../../../../lib/account-link'
|
||||
import QrView from '../../../ui/qr-code'
|
||||
import EditableLabel from '../../../ui/editable-label'
|
||||
import Button from '../../../ui/button'
|
||||
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
||||
import copyToClipboard from 'copy-to-clipboard'
|
||||
import { shortenAddress, checksumAddress } from '../../../helpers/utils/util'
|
||||
|
||||
import Tooltip from '../../ui/tooltip-v2.js'
|
||||
import Tooltip from '../../ui/tooltip-v2'
|
||||
|
||||
class SelectedAccount extends Component {
|
||||
state = {
|
||||
|
@ -3,7 +3,7 @@ import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import ReactCSSTransitionGroup from 'react-transition-group/CSSTransitionGroup'
|
||||
import Sidebar from '../sidebar.component.js'
|
||||
import Sidebar from '../sidebar.component'
|
||||
|
||||
import CustomizeGas from '../../gas-customization/gas-modal-page-container'
|
||||
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import ButtonGroup from '../button-group.component.js'
|
||||
import ButtonGroup from '../button-group.component'
|
||||
|
||||
describe('ButtonGroup Component', function () {
|
||||
let wrapper
|
||||
|
@ -3,7 +3,7 @@ import configureMockStore from 'redux-mock-store'
|
||||
import thunk from 'redux-thunk'
|
||||
import sinon from 'sinon'
|
||||
|
||||
import ConfirmTransactionReducer, * as actions from './confirm-transaction.duck.js'
|
||||
import ConfirmTransactionReducer, * as actions from './confirm-transaction.duck'
|
||||
|
||||
const initialState = {
|
||||
txData: {},
|
||||
|
@ -6,7 +6,7 @@ import SendReducer, {
|
||||
updateSendErrors,
|
||||
showGasButtonGroup,
|
||||
hideGasButtonGroup,
|
||||
} from './send.duck.js'
|
||||
} from './send.duck'
|
||||
|
||||
describe('Send Duck', function () {
|
||||
const mockState = {
|
||||
|
@ -1 +1 @@
|
||||
export { default } from './initialized.container.js'
|
||||
export { default } from './initialized.container'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { decimalToHex } from '../../helpers/utils/conversions.util'
|
||||
import { calcTokenValue } from '../../helpers/utils/token-util.js'
|
||||
import { calcTokenValue } from '../../helpers/utils/token-util'
|
||||
import { getTokenData } from '../../helpers/utils/transactions.util'
|
||||
|
||||
export function getCustomTxParamsData (data, { customPermissionAmount, decimals }) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import React, { Component } from 'react'
|
||||
import Select from 'react-select'
|
||||
import genAccountLink from '../../../../lib/account-link.js'
|
||||
import genAccountLink from '../../../../lib/account-link'
|
||||
import Button from '../../../components/ui/button'
|
||||
|
||||
class AccountList extends Component {
|
||||
|
@ -3,9 +3,8 @@ import PropTypes from 'prop-types'
|
||||
import Select from 'react-select'
|
||||
|
||||
// Subviews
|
||||
import JsonImportView from './json.js'
|
||||
|
||||
import PrivateKeyImportView from './private-key.js'
|
||||
import JsonImportView from './json'
|
||||
import PrivateKeyImportView from './private-key'
|
||||
|
||||
export default class AccountImportSubview extends Component {
|
||||
static contextTypes = {
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
getSendMaxModeState,
|
||||
getBasicGasEstimateLoadingStatus,
|
||||
} from '../../../../../selectors'
|
||||
import { calcMaxAmount } from './amount-max-button.utils.js'
|
||||
import { calcMaxAmount } from './amount-max-button.utils'
|
||||
import {
|
||||
updateSendAmount,
|
||||
setMaxModeTo,
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import AmountMaxButton from '../amount-max-button.component.js'
|
||||
import AmountMaxButton from '../amount-max-button.component'
|
||||
|
||||
describe('AmountMaxButton Component', function () {
|
||||
let wrapper
|
||||
|
@ -1,7 +1,7 @@
|
||||
import assert from 'assert'
|
||||
import {
|
||||
calcMaxAmount,
|
||||
} from '../amount-max-button.utils.js'
|
||||
} from '../amount-max-button.utils'
|
||||
|
||||
describe('amount-max-button utils', function () {
|
||||
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import SendAmountRow from '../send-amount-row.component.js'
|
||||
import SendAmountRow from '../send-amount-row.component'
|
||||
|
||||
import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component'
|
||||
import AmountMaxButton from '../amount-max-button/amount-max-button.container'
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
import {
|
||||
isBalanceSufficient,
|
||||
calcGasTotal,
|
||||
} from '../../send.utils.js'
|
||||
} from '../../send.utils'
|
||||
import { calcMaxAmount } from '../send-amount-row/amount-max-button/amount-max-button.utils'
|
||||
import {
|
||||
showGasButtonGroup,
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import SendGasRow from '../send-gas-row.component.js'
|
||||
import SendGasRow from '../send-gas-row.component'
|
||||
|
||||
import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component'
|
||||
import GasFeeDisplay from '../gas-fee-display/gas-fee-display.component'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import SendRowErrorMessage from '../send-row-error-message.component.js'
|
||||
import SendRowErrorMessage from '../send-row-error-message.component'
|
||||
|
||||
describe('SendRowErrorMessage Component', function () {
|
||||
let wrapper
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import SendRowWrapper from '../send-row-wrapper.component.js'
|
||||
import SendRowWrapper from '../send-row-wrapper.component'
|
||||
|
||||
import SendRowErrorMessage from '../send-row-error-message/send-row-error-message.container'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import SendContent from '../send-content.component.js'
|
||||
import SendContent from '../send-content.component'
|
||||
|
||||
import PageContainerContent from '../../../../components/ui/page-container/page-container-content.component'
|
||||
import SendAmountRow from '../send-amount-row/send-amount-row.container'
|
||||
|
@ -3,7 +3,7 @@ import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import { CONFIRM_TRANSACTION_ROUTE } from '../../../../helpers/constants/routes'
|
||||
import SendFooter from '../send-footer.component.js'
|
||||
import SendFooter from '../send-footer.component'
|
||||
import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer'
|
||||
|
||||
describe('SendFooter Component', function () {
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import assert from 'assert'
|
||||
import { shallow } from 'enzyme'
|
||||
import sinon from 'sinon'
|
||||
import SendHeader from '../send-header.component.js'
|
||||
import SendHeader from '../send-header.component'
|
||||
import PageContainerHeader from '../../../../components/ui/page-container/page-container-header'
|
||||
|
||||
describe('SendHeader Component', function () {
|
||||
|
@ -45,7 +45,7 @@ import {
|
||||
import { getTokens } from '../../ducks/metamask/metamask'
|
||||
import {
|
||||
calcGasTotal,
|
||||
} from './send.utils.js'
|
||||
} from './send.utils'
|
||||
import {
|
||||
isValidDomainName,
|
||||
} from '../../helpers/utils/util'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import availableCurrencies from '../../../helpers/constants/available-conversions'
|
||||
import availableCurrencies from '../../../helpers/constants/available-conversions.json'
|
||||
import SimpleDropdown from '../../../components/app/dropdowns/simple-dropdown'
|
||||
import ToggleButton from '../../../components/ui/toggle-button'
|
||||
import locales from '../../../../../app/_locales/index.json'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import FeeCard from './fee-card.js'
|
||||
import FeeCard from './fee-card'
|
||||
import { action } from '@storybook/addon-actions'
|
||||
import { text } from '@storybook/addon-knobs/react'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user