Skip to content

Commit

Permalink
Add param type
Browse files Browse the repository at this point in the history
To fix error in CI
  • Loading branch information
yubaoquan committed Oct 10, 2017
1 parent 809c407 commit 1865f5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/tooltip/fix-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React from 'react'

class FixButton extends React.Component {
handleClick() {
handleClick(): void {
this.props.cb()
}
render() {
Expand Down
6 changes: 3 additions & 3 deletions lib/tooltip/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import marked from 'marked'

import { visitMessage, openExternally, openFile, applySolution, getActiveTextEditor, sortSolutions } from '../helpers'
import type TooltipDelegate from './delegate'
import type { Message } from '../types'
import type { Message, LinterMessage } from '../types'
import FixButton from './fix-button'

function findHref(el: ?Element): ?string {
Expand Down Expand Up @@ -101,15 +101,15 @@ class MessageElement extends React.Component {
const column = query && query.column ? parseInt(query.column, 10) : 0
openFile(file, { row, column })
}
canBeFixed(message):boolean {
canBeFixed(message: LinterMessage): boolean {
if (message.version === 1 && message.fix) {
return true
} else if (message.version === 2 && message.solutions && message.solutions.length) {
return true
}
return false
}
onFixClick(message) {
onFixClick(message: LinterMessage): void {
const textEditor = getActiveTextEditor()
if (message.version === 1 && message.fix) {
applySolution(textEditor, 1, message.fix)
Expand Down

0 comments on commit 1865f5b

Please sign in to comment.