mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Disable semicolons for class props (#7754)
This commit is contained in:
parent
28defaf7e6
commit
c66449f823
@ -27,6 +27,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
"babel",
|
||||||
"mocha",
|
"mocha",
|
||||||
"chai",
|
"chai",
|
||||||
"react",
|
"react",
|
||||||
@ -180,6 +181,7 @@
|
|||||||
"prop": "parens-new-line"
|
"prop": "parens-new-line"
|
||||||
}],
|
}],
|
||||||
"semi": [2, "never"],
|
"semi": [2, "never"],
|
||||||
|
"babel/semi": [2, "never"],
|
||||||
"semi-spacing": [2, { "before": false, "after": true }],
|
"semi-spacing": [2, { "before": false, "after": true }],
|
||||||
"space-before-blocks": [2, "always"],
|
"space-before-blocks": [2, "always"],
|
||||||
"space-before-function-paren": [2, "always"],
|
"space-before-function-paren": [2, "always"],
|
||||||
|
@ -219,6 +219,7 @@
|
|||||||
"enzyme": "^3.10.0",
|
"enzyme": "^3.10.0",
|
||||||
"enzyme-adapter-react-16": "^1.15.1",
|
"enzyme-adapter-react-16": "^1.15.1",
|
||||||
"eslint": "^6.0.1",
|
"eslint": "^6.0.1",
|
||||||
|
"eslint-plugin-babel": "^5.3.0",
|
||||||
"eslint-plugin-chai": "0.0.1",
|
"eslint-plugin-chai": "0.0.1",
|
||||||
"eslint-plugin-import": "^2.18.2",
|
"eslint-plugin-import": "^2.18.2",
|
||||||
"eslint-plugin-json": "^1.2.0",
|
"eslint-plugin-json": "^1.2.0",
|
||||||
|
@ -44,7 +44,7 @@ export default class AccountMenu extends Component {
|
|||||||
originOfCurrentTab: PropTypes.string,
|
originOfCurrentTab: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
accountsRef;
|
accountsRef
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
shouldShowScrollButton: false,
|
shouldShowScrollButton: false,
|
||||||
|
@ -16,7 +16,7 @@ export default class PermissionPageContainer extends Component {
|
|||||||
permissionRejected: PropTypes.bool,
|
permissionRejected: PropTypes.bool,
|
||||||
requestMetadata: PropTypes.object,
|
requestMetadata: PropTypes.object,
|
||||||
targetDomainMetadata: PropTypes.object.isRequired,
|
targetDomainMetadata: PropTypes.object.isRequired,
|
||||||
};
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
redirect: null,
|
redirect: null,
|
||||||
@ -24,12 +24,12 @@ export default class PermissionPageContainer extends Component {
|
|||||||
request: {},
|
request: {},
|
||||||
requestMetadata: {},
|
requestMetadata: {},
|
||||||
selectedIdentity: {},
|
selectedIdentity: {},
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
metricsEvent: PropTypes.func,
|
metricsEvent: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
selectedPermissions: this.getRequestedMethodState(
|
selectedPermissions: this.getRequestedMethodState(
|
||||||
|
@ -15,7 +15,7 @@ export default class Sidebar extends Component {
|
|||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
sidebarProps: PropTypes.object,
|
sidebarProps: PropTypes.object,
|
||||||
onOverlayClose: PropTypes.func,
|
onOverlayClose: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
renderOverlay () {
|
renderOverlay () {
|
||||||
const { onOverlayClose } = this.props
|
const { onOverlayClose } = this.props
|
||||||
|
@ -5,7 +5,7 @@ export default class PageContainerContent extends Component {
|
|||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
|
@ -10,14 +10,14 @@ class ReactTooltip extends Component {
|
|||||||
position: PropTypes.oneOf(['left', 'top', 'right', 'bottom']),
|
position: PropTypes.oneOf(['left', 'top', 'right', 'bottom']),
|
||||||
fixed: PropTypes.bool,
|
fixed: PropTypes.bool,
|
||||||
space: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
space: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
};
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
container: document.body,
|
container: document.body,
|
||||||
position: 'top',
|
position: 'top',
|
||||||
fixed: true,
|
fixed: true,
|
||||||
space: 5,
|
space: 5,
|
||||||
};
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
this.container = this.props.container || document.body
|
this.container = this.props.container || document.body
|
||||||
@ -40,26 +40,26 @@ class ReactTooltip extends Component {
|
|||||||
|
|
||||||
this.componentEl.addEventListener(this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove)
|
this.componentEl.addEventListener(this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove)
|
||||||
this.componentEl.addEventListener('mouseleave', this.handleMouseOut)
|
this.componentEl.addEventListener('mouseleave', this.handleMouseOut)
|
||||||
};
|
}
|
||||||
|
|
||||||
componentDidUpdate = () => {
|
componentDidUpdate = () => {
|
||||||
this.tooltipEl.className = 'tooltip ' + this.props.position
|
this.tooltipEl.className = 'tooltip ' + this.props.position
|
||||||
this.tooltipEl.childNodes[1].textContent = this.props.title
|
this.tooltipEl.childNodes[1].textContent = this.props.title
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
componentWillUnmount = () => {
|
componentWillUnmount = () => {
|
||||||
this.componentEl.removeEventListener(this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove)
|
this.componentEl.removeEventListener(this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove)
|
||||||
this.componentEl.removeEventListener('mouseleave', this.handleMouseOut)
|
this.componentEl.removeEventListener('mouseleave', this.handleMouseOut)
|
||||||
this.container.removeChild(this.tooltipEl)
|
this.container.removeChild(this.tooltipEl)
|
||||||
};
|
}
|
||||||
|
|
||||||
resetTooltip = () => {
|
resetTooltip = () => {
|
||||||
this.tooltipEl.style.transition = 'opacity 0.4s'
|
this.tooltipEl.style.transition = 'opacity 0.4s'
|
||||||
this.tooltipEl.style.left = '-500px'
|
this.tooltipEl.style.left = '-500px'
|
||||||
this.tooltipEl.style.top = '-500px'
|
this.tooltipEl.style.top = '-500px'
|
||||||
this.tooltipEl.style.opacity = 0
|
this.tooltipEl.style.opacity = 0
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMouseMove = (e) => {
|
handleMouseMove = (e) => {
|
||||||
if (this.props.title === '') {
|
if (this.props.title === '') {
|
||||||
@ -72,11 +72,11 @@ class ReactTooltip extends Component {
|
|||||||
this.tooltipEl.style.left = tooltipPosition.x + tooltipOffset.x + 'px'
|
this.tooltipEl.style.left = tooltipPosition.x + tooltipOffset.x + 'px'
|
||||||
this.tooltipEl.style.top = tooltipPosition.y + tooltipOffset.y + 'px'
|
this.tooltipEl.style.top = tooltipPosition.y + tooltipOffset.y + 'px'
|
||||||
this.tooltipEl.style.opacity = 1
|
this.tooltipEl.style.opacity = 1
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMouseOut = () => {
|
handleMouseOut = () => {
|
||||||
this.resetTooltip()
|
this.resetTooltip()
|
||||||
};
|
}
|
||||||
|
|
||||||
getTooltipPosition = (e) => {
|
getTooltipPosition = (e) => {
|
||||||
let pointX
|
let pointX
|
||||||
@ -127,7 +127,7 @@ class ReactTooltip extends Component {
|
|||||||
x: pointX,
|
x: pointX,
|
||||||
y: pointY,
|
y: pointY,
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
getTooltipOffset = () => {
|
getTooltipOffset = () => {
|
||||||
const tooltipW = this.tooltipEl.offsetWidth
|
const tooltipW = this.tooltipEl.offsetWidth
|
||||||
@ -160,7 +160,7 @@ class ReactTooltip extends Component {
|
|||||||
x: offsetX,
|
x: offsetX,
|
||||||
y: offsetY,
|
y: offsetY,
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return this.props.children
|
return this.props.children
|
||||||
|
@ -22,7 +22,7 @@ class RestoreVaultPage extends Component {
|
|||||||
history: PropTypes.object,
|
history: PropTypes.object,
|
||||||
isLoading: PropTypes.bool,
|
isLoading: PropTypes.bool,
|
||||||
initializeThreeBox: PropTypes.func,
|
initializeThreeBox: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
seedPhrase: '',
|
seedPhrase: '',
|
||||||
|
@ -27,7 +27,7 @@ export default class ChooseAccount extends Component {
|
|||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
renderAccountsList = () => {
|
renderAccountsList = () => {
|
||||||
const { accounts, selectAccount, nativeCurrency, addressLastConnectedMap } = this.props
|
const { accounts, selectAccount, nativeCurrency, addressLastConnectedMap } = this.props
|
||||||
|
@ -18,7 +18,7 @@ export default class AccountListItem extends Component {
|
|||||||
icon: PropTypes.node,
|
icon: PropTypes.node,
|
||||||
balanceIsCached: PropTypes.bool,
|
balanceIsCached: PropTypes.bool,
|
||||||
showFiat: PropTypes.bool,
|
showFiat: PropTypes.bool,
|
||||||
};
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
showFiat: true,
|
showFiat: true,
|
||||||
@ -26,7 +26,7 @@ export default class AccountListItem extends Component {
|
|||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
@ -9,11 +9,11 @@ export default class SendDropdownList extends Component {
|
|||||||
closeDropdown: PropTypes.func,
|
closeDropdown: PropTypes.func,
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
activeAddress: PropTypes.string,
|
activeAddress: PropTypes.string,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
getListItemIcon (accountAddress, activeAddress) {
|
getListItemIcon (accountAddress, activeAddress) {
|
||||||
return accountAddress === activeAddress
|
return accountAddress === activeAddress
|
||||||
|
@ -9,11 +9,11 @@ export default class GasFeeDisplay extends Component {
|
|||||||
gasLoadingError: PropTypes.bool,
|
gasLoadingError: PropTypes.bool,
|
||||||
gasTotal: PropTypes.string,
|
gasTotal: PropTypes.string,
|
||||||
onReset: PropTypes.func,
|
onReset: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { gasTotal, gasLoadingError, onReset } = this.props
|
const { gasTotal, gasLoadingError, onReset } = this.props
|
||||||
|
@ -31,7 +31,7 @@ export default class SendGasRow extends Component {
|
|||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
metricsEvent: PropTypes.func,
|
metricsEvent: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
renderAdvancedOptionsButton () {
|
renderAdvancedOptionsButton () {
|
||||||
const { metricsEvent } = this.context
|
const { metricsEvent } = this.context
|
||||||
|
@ -7,11 +7,11 @@ export default class SendHexDataRow extends Component {
|
|||||||
inError: PropTypes.bool,
|
inError: PropTypes.bool,
|
||||||
updateSendHexData: PropTypes.func.isRequired,
|
updateSendHexData: PropTypes.func.isRequired,
|
||||||
updateGas: PropTypes.func.isRequired,
|
updateGas: PropTypes.func.isRequired,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
onInput = (event) => {
|
onInput = (event) => {
|
||||||
const { updateSendHexData, updateGas } = this.props
|
const { updateSendHexData, updateGas } = this.props
|
||||||
|
@ -7,11 +7,11 @@ export default class SendRowErrorMessage extends Component {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
errors: PropTypes.object,
|
errors: PropTypes.object,
|
||||||
errorType: PropTypes.string,
|
errorType: PropTypes.string,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { errors, errorType } = this.props
|
const { errors, errorType } = this.props
|
||||||
|
@ -9,11 +9,11 @@ export default class SendRowWrapper extends Component {
|
|||||||
errorType: PropTypes.string,
|
errorType: PropTypes.string,
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
showError: PropTypes.bool,
|
showError: PropTypes.bool,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
renderAmountFormRow () {
|
renderAmountFormRow () {
|
||||||
const {
|
const {
|
||||||
|
@ -31,7 +31,7 @@ export default class SendFooter extends Component {
|
|||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
metricsEvent: PropTypes.func,
|
metricsEvent: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
onCancel () {
|
onCancel () {
|
||||||
this.props.clearSend()
|
this.props.clearSend()
|
||||||
|
@ -9,11 +9,11 @@ export default class SendHeader extends Component {
|
|||||||
clearSend: PropTypes.func,
|
clearSend: PropTypes.func,
|
||||||
history: PropTypes.object,
|
history: PropTypes.object,
|
||||||
titleKey: PropTypes.string,
|
titleKey: PropTypes.string,
|
||||||
};
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
};
|
}
|
||||||
|
|
||||||
onClose () {
|
onClose () {
|
||||||
this.props.clearSend()
|
this.props.clearSend()
|
||||||
|
12
yarn.lock
12
yarn.lock
@ -9929,6 +9929,13 @@ eslint-module-utils@^2.4.0:
|
|||||||
debug "^2.6.8"
|
debug "^2.6.8"
|
||||||
pkg-dir "^2.0.0"
|
pkg-dir "^2.0.0"
|
||||||
|
|
||||||
|
eslint-plugin-babel@^5.3.0:
|
||||||
|
version "5.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023"
|
||||||
|
integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w==
|
||||||
|
dependencies:
|
||||||
|
eslint-rule-composer "^0.3.0"
|
||||||
|
|
||||||
eslint-plugin-chai@0.0.1:
|
eslint-plugin-chai@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-chai/-/eslint-plugin-chai-0.0.1.tgz#9a1dea58b335c31242219d059b37ffb14309f6e1"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-chai/-/eslint-plugin-chai-0.0.1.tgz#9a1dea58b335c31242219d059b37ffb14309f6e1"
|
||||||
@ -9982,6 +9989,11 @@ eslint-plugin-react@^7.4.0:
|
|||||||
jsx-ast-utils "^2.0.0"
|
jsx-ast-utils "^2.0.0"
|
||||||
prop-types "^15.6.0"
|
prop-types "^15.6.0"
|
||||||
|
|
||||||
|
eslint-rule-composer@^0.3.0:
|
||||||
|
version "0.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
|
||||||
|
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
|
||||||
|
|
||||||
eslint-scope@3.7.1, eslint-scope@^3.7.1:
|
eslint-scope@3.7.1, eslint-scope@^3.7.1:
|
||||||
version "3.7.1"
|
version "3.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
|
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
|
||||||
|
Loading…
Reference in New Issue
Block a user