Skip to content

Commit

Permalink
Disable semicolons for class props (#7754)
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh authored Jan 7, 2020
1 parent 28defaf commit c66449f
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},

"plugins": [
"babel",
"mocha",
"chai",
"react",
Expand Down Expand Up @@ -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"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class AccountMenu extends Component {
originOfCurrentTab: PropTypes.string,
}

accountsRef;
accountsRef

state = {
shouldShowScrollButton: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ export default class PermissionPageContainer extends Component {
permissionRejected: PropTypes.bool,
requestMetadata: PropTypes.object,
targetDomainMetadata: PropTypes.object.isRequired,
};
}

static defaultProps = {
redirect: null,
permissionRejected: null,
request: {},
requestMetadata: {},
selectedIdentity: {},
};
}

static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}

state = {
selectedPermissions: this.getRequestedMethodState(
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/app/sidebars/sidebar.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Sidebar extends Component {
type: PropTypes.string,
sidebarProps: PropTypes.object,
onOverlayClose: PropTypes.func,
};
}

renderOverlay () {
const { onOverlayClose } = this.props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class PageContainerContent extends Component {

static propTypes = {
children: PropTypes.node.isRequired,
};
}

render () {
return (
Expand Down
20 changes: 10 additions & 10 deletions ui/app/components/ui/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 === '') {
Expand All @@ -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
Expand Down Expand Up @@ -127,7 +127,7 @@ class ReactTooltip extends Component {
x: pointX,
y: pointY,
}
};
}

getTooltipOffset = () => {
const tooltipW = this.tooltipEl.offsetWidth
Expand Down Expand Up @@ -160,7 +160,7 @@ class ReactTooltip extends Component {
x: offsetX,
y: offsetY,
}
};
}

render () {
return this.props.children
Expand Down
2 changes: 1 addition & 1 deletion ui/app/pages/keychains/restore-vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RestoreVaultPage extends Component {
history: PropTypes.object,
isLoading: PropTypes.bool,
initializeThreeBox: PropTypes.func,
};
}

state = {
seedPhrase: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class ChooseAccount extends Component {

static contextTypes = {
t: PropTypes.func,
};
}

renderAccountsList = () => {
const { accounts, selectAccount, nativeCurrency, addressLastConnectedMap } = this.props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export default class AccountListItem extends Component {
icon: PropTypes.node,
balanceIsCached: PropTypes.bool,
showFiat: PropTypes.bool,
};
}

static defaultProps = {
showFiat: true,
}

static contextTypes = {
t: PropTypes.func,
};
}

render () {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class SendGasRow extends Component {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}

renderAdvancedOptionsButton () {
const { metricsEvent } = this.context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/pages/send/send-footer/send-footer.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class SendFooter extends Component {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
};
}

onCancel () {
this.props.clearSend()
Expand Down
4 changes: 2 additions & 2 deletions ui/app/pages/send/send-header/send-header.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c66449f

Please sign in to comment.