Skip to content

Commit 24a8c97

Browse files
fix: linting issues
1 parent 2e8477d commit 24a8c97

5 files changed

Lines changed: 29 additions & 26 deletions

File tree

source/cli.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
2-
import React from 'react'
32
import { render } from 'ink'
3+
import React from 'react'
44
import App from './app.js'
55

66
console.clear()

source/import/Ask.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { type FC, useMemo, useState } from 'react'
21
import { Box, Text } from 'ink'
32
import TextInput from 'ink-text-input'
3+
import React, { type FC, useMemo, useState } from 'react'
44
import { isAnswerConfirmed } from './utils.js'
55

66
interface Props {
@@ -17,20 +17,24 @@ const Ask: FC<Props> = ({ question, onSubmit, answer, tip, errorMessage, placeho
1717
const answered = useMemo(() => isAnswerConfirmed(answer, errorMessage), [answer, errorMessage])
1818

1919
return (
20-
<Box flexDirection={'column'} rowGap={1}>
20+
<Box
21+
flexDirection={'column'}
22+
rowGap={1}
23+
>
2124
<Box flexDirection={'column'}>
2225
<Box>
2326
<Text color={'whiteBright'}>{question}: </Text>
2427
{answered ? (
25-
<Text bold color={'green'}>
28+
<Text
29+
bold
30+
color={'green'}
31+
>
2632
{answer}
2733
</Text>
2834
) : (
2935
<TextInput
3036
onChange={setInput}
31-
onSubmit={(value) => {
32-
onSubmit(value)
33-
}}
37+
onSubmit={onSubmit}
3438
placeholder={placeholder}
3539
value={input}
3640
/>
@@ -39,7 +43,10 @@ const Ask: FC<Props> = ({ question, onSubmit, answer, tip, errorMessage, placeho
3943
{tip && <Text color={'gray'}>{tip}</Text>}
4044
</Box>
4145
{errorMessage && (
42-
<Text bold color={'red'}>
46+
<Text
47+
bold
48+
color={'red'}
49+
>
4350
{errorMessage}
4451
</Text>
4552
)}

source/import/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExecSyncOptions } from 'child_process'
1+
import type { ExecSyncOptions } from 'node:child_process'
22

33
export const repoUrl = 'https://github.com/BootNodeDev/dAppBooster.git'
44
export const homeFolder = '/src/components/pageComponents/home'

source/import/utils.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
function isValidName(name: string) {
1+
export function isValidName(name: string) {
22
return /^[a-zA-Z0-9-_]+$/.test(name)
33
}
44

5-
export function validateName(name: string): string {
6-
if (name.length > 0 && !isValidName(name)) return 'Not a valid name!'
7-
8-
return ''
9-
}
10-
11-
export function isAnswerConfirmed(answer?: string, errorMessage?: string) {
5+
export function isAnswerConfirmed(answer?: string, errorMessage?: string): boolean {
126
return (
137
answer !== '' && answer !== undefined && (errorMessage === '' || errorMessage === undefined)
148
)
159
}
10+
11+
export function canShowStep(currentStep: number, stepToShow: number) {
12+
return currentStep > stepToShow - 1
13+
}

tsconfig.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
2-
"extends": "@sindresorhus/tsconfig",
3-
"compilerOptions": {
4-
"outDir": "dist",
5-
"noUnusedLocals": false,
6-
"noUnusedParameters": false
7-
},
8-
"include": [
9-
"source"
10-
]
2+
"extends": "@sindresorhus/tsconfig",
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"noUnusedLocals": false,
6+
"noUnusedParameters": false
7+
},
8+
"include": ["source"]
119
}

0 commit comments

Comments
 (0)