Skip to content

Commit c0344dd

Browse files
committed
optimize(projects): optimize code with lint
1 parent 262a4f0 commit c0344dd

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

packages/githublogen/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22
import process from 'node:process';
3+
import { getChangelogMarkdown } from '@soybeanjs/changelog';
34
import cac from 'cac';
45
import { consola } from 'consola';
56
import { blue, bold, cyan, dim, red, yellow } from 'kolorist';
6-
import { getChangelogMarkdown } from '@soybeanjs/changelog';
77
import { version } from '../package.json';
88
import { hasTagOnGitHub, isRepoShallow, sendRelease } from './github';
99

packages/githublogen/src/github.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import type { ChangelogOption } from '@soybeanjs/changelog';
12
import { ofetch } from 'ofetch';
23
import { consola } from 'consola';
34
import { cyan, green, red, yellow } from 'kolorist';
4-
import type { ChangelogOption } from '@soybeanjs/changelog';
55

66
function getHeaders(githubToken: string) {
77
return {
@@ -16,7 +16,7 @@ export async function hasTagOnGitHub(tag: string, repo: string, githubToken: str
1616
headers: getHeaders(githubToken)
1717
});
1818
return true;
19-
} catch (e) {
19+
} catch {
2020
return false;
2121
}
2222
}
@@ -37,7 +37,7 @@ export async function sendRelease(options: ChangelogOption, content: string) {
3737
url = exists.url;
3838
method = 'PATCH';
3939
}
40-
} catch (e) {}
40+
} catch {}
4141

4242
const body = {
4343
body: content,

src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ofetch } from 'ofetch';
21
import dayjs from 'dayjs';
2+
import { ofetch } from 'ofetch';
33
import { consola } from 'consola';
44
import semver from 'semver';
55
import { execCommand, notNullish } from './shared';

src/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export async function isVersionInMarkdown(newVersion: string, mdPath: string) {
203203
let md = '';
204204
try {
205205
md = await readFile(mdPath, 'utf8');
206-
} catch (error) {}
206+
} catch {}
207207

208208
if (md) {
209209
const matches = md.match(VERSION_REG_OF_MARKDOWN);

src/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable max-params */
12
import type { Options } from 'execa';
23

34
export async function execCommand(cmd: string, args: string[], options?: Options) {

0 commit comments

Comments
 (0)