Skip to content

Commit 32bed8f

Browse files
committed
chore: lint fix
1 parent 4fa30c1 commit 32bed8f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cli/run.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function run(options: RuleOptions = {}) {
7373

7474
let eslintConfigContent: string = ''
7575

76-
const coderwydConfig = `${eslintIgnores.length ? `ignores: ${JSON.stringify(eslintIgnores)}` : ''}`
76+
const coderwydConfig = `${eslintIgnores.length > 0 ? `ignores: ${JSON.stringify(eslintIgnores)}` : ''}`
7777
if (pkg.type === 'module') {
7878
eslintConfigContent = `
7979
import { defineConfig } from '@coderwyd/eslint-config'
@@ -96,7 +96,7 @@ module.exports = defineConfig({\n${coderwydConfig}\n})
9696
files.forEach(file => {
9797
if (file.includes('eslint') || file.includes('prettier')) legacyConfig.push(file)
9898
})
99-
if (legacyConfig.length) {
99+
if (legacyConfig.length > 0) {
100100
console.log(`${WARN} you can now remove those files manually:`)
101101
console.log(` ${c.dim(legacyConfig.join(', '))}`)
102102
}
@@ -122,8 +122,8 @@ module.exports = defineConfig({\n${coderwydConfig}\n})
122122
},
123123
},
124124
)
125-
} catch (cancelled: any) {
126-
console.log(cancelled.message)
125+
} catch (error: any) {
126+
console.log(error.message)
127127
return
128128
}
129129
}

src/cli/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function isGitClean() {
44
try {
55
execSync('git diff-index --quiet HEAD --')
66
return true
7-
} catch (error) {
7+
} catch {
88
return false
99
}
1010
}

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export async function defineConfig(
175175
if (key in options) acc[key] = options[key] as any
176176
return acc
177177
}, {} as FlatConfigItem)
178-
if (Object.keys(fusedConfig).length) configs.push([fusedConfig])
178+
if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig])
179179

180180
const merged = combine(...configs, ...userConfigs)
181181

0 commit comments

Comments
 (0)