1
0
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:
Whymarrh Whitby 2020-01-07 16:40:44 -03:30 committed by GitHub
parent 28defaf7e6
commit c66449f823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 49 additions and 34 deletions

View File

@ -27,6 +27,7 @@
},
"plugins": [
"babel",
"mocha",
"chai",
"react",
@ -180,6 +181,7 @@
"prop": "parens-new-line"
}],
"semi": [2, "never"],
"babel/semi": [2, "never"],
"semi-spacing": [2, { "before": false, "after": true }],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "always"],

View File

@ -219,6 +219,7 @@
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^6.0.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-chai": "0.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-json": "^1.2.0",

View File

@ -44,7 +44,7 @@ export default class AccountMenu extends Component {
originOfCurrentTab: PropTypes.string,
}
accountsRef;
accountsRef
state = {
shouldShowScrollButton: false,

View File

@ -16,7 +16,7 @@ export default class PermissionPageContainer extends Component {
permissionRejected: PropTypes.bool,
requestMetadata: PropTypes.object,
targetDomainMetadata: PropTypes.object.isRequired,
};
}
static defaultProps = {
redirect: null,
@ -24,12 +24,12 @@ export default class PermissionPageContainer extends Component {
request: {},
requestMetadata: {},
selectedIdentity: {},
};
}
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}
state = {
selectedPermissions: this.getRequestedMethodState(

View File

@ -15,7 +15,7 @@ export default class Sidebar extends Component {
type: PropTypes.string,
sidebarProps: PropTypes.object,
onOverlayClose: PropTypes.func,
};
}
renderOverlay () {
const { onOverlayClose } = this.props

View File

@ -5,7 +5,7 @@ export default class PageContainerContent extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
};
}
render () {
return (

View File

@ -10,14 +10,14 @@ class ReactTooltip extends Component {
position: PropTypes.oneOf(['left', 'top', 'right', 'bottom']),
fixed: PropTypes.bool,
space: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
}
static defaultProps = {
container: document.body,
position: 'top',
fixed: true,
space: 5,
};
}
componentDidMount = () => {
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('mouseleave', this.handleMouseOut)
};
}
componentDidUpdate = () => {
this.tooltipEl.className = 'tooltip ' + this.props.position
this.tooltipEl.childNodes[1].textContent = this.props.title
};
}
componentWillUnmount = () => {
this.componentEl.removeEventListener(this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove)
this.componentEl.removeEventListener('mouseleave', this.handleMouseOut)
this.container.removeChild(this.tooltipEl)
};
}
resetTooltip = () => {
this.tooltipEl.style.transition = 'opacity 0.4s'
this.tooltipEl.style.left = '-500px'
this.tooltipEl.style.top = '-500px'
this.tooltipEl.style.opacity = 0
};
}
handleMouseMove = (e) => {
if (this.props.title === '') {
@ -72,11 +72,11 @@ class ReactTooltip extends Component {
this.tooltipEl.style.left = tooltipPosition.x + tooltipOffset.x + 'px'
this.tooltipEl.style.top = tooltipPosition.y + tooltipOffset.y + 'px'
this.tooltipEl.style.opacity = 1
};
}
handleMouseOut = () => {
this.resetTooltip()
};
}
getTooltipPosition = (e) => {
let pointX
@ -127,7 +127,7 @@ class ReactTooltip extends Component {
x: pointX,
y: pointY,
}
};
}
getTooltipOffset = () => {
const tooltipW = this.tooltipEl.offsetWidth
@ -160,7 +160,7 @@ class ReactTooltip extends Component {
x: offsetX,
y: offsetY,
}
};
}
render () {
return this.props.children

View File

@ -22,7 +22,7 @@ class RestoreVaultPage extends Component {
history: PropTypes.object,
isLoading: PropTypes.bool,
initializeThreeBox: PropTypes.func,
};
}
state = {
seedPhrase: '',

View File

@ -27,7 +27,7 @@ export default class ChooseAccount extends Component {
static contextTypes = {
t: PropTypes.func,
};
}
renderAccountsList = () => {
const { accounts, selectAccount, nativeCurrency, addressLastConnectedMap } = this.props

View File

@ -18,7 +18,7 @@ export default class AccountListItem extends Component {
icon: PropTypes.node,
balanceIsCached: PropTypes.bool,
showFiat: PropTypes.bool,
};
}
static defaultProps = {
showFiat: true,
@ -26,7 +26,7 @@ export default class AccountListItem extends Component {
static contextTypes = {
t: PropTypes.func,
};
}
render () {
const {

View File

@ -9,11 +9,11 @@ export default class SendDropdownList extends Component {
closeDropdown: PropTypes.func,
onSelect: PropTypes.func,
activeAddress: PropTypes.string,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
getListItemIcon (accountAddress, activeAddress) {
return accountAddress === activeAddress

View File

@ -9,11 +9,11 @@ export default class GasFeeDisplay extends Component {
gasLoadingError: PropTypes.bool,
gasTotal: PropTypes.string,
onReset: PropTypes.func,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
render () {
const { gasTotal, gasLoadingError, onReset } = this.props

View File

@ -31,7 +31,7 @@ export default class SendGasRow extends Component {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}
renderAdvancedOptionsButton () {
const { metricsEvent } = this.context

View File

@ -7,11 +7,11 @@ export default class SendHexDataRow extends Component {
inError: PropTypes.bool,
updateSendHexData: PropTypes.func.isRequired,
updateGas: PropTypes.func.isRequired,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
onInput = (event) => {
const { updateSendHexData, updateGas } = this.props

View File

@ -7,11 +7,11 @@ export default class SendRowErrorMessage extends Component {
static propTypes = {
errors: PropTypes.object,
errorType: PropTypes.string,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
render () {
const { errors, errorType } = this.props

View File

@ -9,11 +9,11 @@ export default class SendRowWrapper extends Component {
errorType: PropTypes.string,
label: PropTypes.string,
showError: PropTypes.bool,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
renderAmountFormRow () {
const {

View File

@ -31,7 +31,7 @@ export default class SendFooter extends Component {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}
onCancel () {
this.props.clearSend()

View File

@ -9,11 +9,11 @@ export default class SendHeader extends Component {
clearSend: PropTypes.func,
history: PropTypes.object,
titleKey: PropTypes.string,
};
}
static contextTypes = {
t: PropTypes.func,
};
}
onClose () {
this.props.clearSend()

View File

@ -9929,6 +9929,13 @@ eslint-module-utils@^2.4.0:
debug "^2.6.8"
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:
version "0.0.1"
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"
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:
version "3.7.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"