diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-22 10:01:24 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-22 10:48:39 +0900 |
commit | 2e7006ce24c42ec2b6642346d153429338e7334e (patch) | |
tree | f1eb9e843ab4ec5d7d3f08fff8c858174b6f1284 /src/console/components | |
parent | 0881f92d20cb7b4f5a75671df739c3eaa3cd0ff0 (diff) |
npm run lint:fix
Diffstat (limited to 'src/console/components')
-rw-r--r-- | src/console/components/Console.tsx | 4 | ||||
-rw-r--r-- | src/console/components/console/Completion.tsx | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/console/components/Console.tsx b/src/console/components/Console.tsx index 1743d15..eafe2a7 100644 --- a/src/console/components/Console.tsx +++ b/src/console/components/Console.tsx @@ -34,7 +34,7 @@ class Console extends React.Component<Props> { e.stopPropagation(); e.preventDefault(); - let value = (e.target as HTMLInputElement).value; + const value = (e.target as HTMLInputElement).value; if (this.props.mode === 'command') { return this.props.dispatch(consoleActions.enterCommand(value)); } else if (this.props.mode === 'find') { @@ -101,7 +101,7 @@ class Console extends React.Component<Props> { } onChange(e: React.ChangeEvent<HTMLInputElement>) { - let text = e.target.value; + const text = e.target.value; this.props.dispatch(consoleActions.setConsoleText(text)); if (this.props.mode === 'command') { this.props.dispatch(consoleActions.getCompletions(text)); diff --git a/src/console/components/console/Completion.tsx b/src/console/components/console/Completion.tsx index 169a39c..e2fa1de 100644 --- a/src/console/components/console/Completion.tsx +++ b/src/console/components/console/Completion.tsx @@ -35,11 +35,11 @@ class Completion extends React.Component<Props, State> { return null; } - let viewSelect = (() => { + const viewSelect = (() => { let index = 0; for (let i = 0; i < nextProps.completions.length; ++i) { ++index; - let g = nextProps.completions[i]; + const g = nextProps.completions[i]; if (nextProps.select + i + 1 < index + g.items.length) { return nextProps.select + i + 1; } @@ -64,12 +64,12 @@ class Completion extends React.Component<Props, State> { let eles = []; let index = 0; - for (let group of this.props.completions) { + for (const group of this.props.completions) { eles.push(<CompletionTitle key={`group-${index}`} title={ group.name } />); - for (let item of group.items) { + for (const item of group.items) { eles.push(<CompletionItem key={`item-${index}`} icon={item.icon} @@ -81,7 +81,7 @@ class Completion extends React.Component<Props, State> { } } - let viewOffset = this.state.viewOffset; + const viewOffset = this.state.viewOffset; eles = eles.slice(viewOffset, viewOffset + this.props.size); return ( |