Skip to content

Commit 2ae3c47

Browse files
committed
chore: lint fix
1 parent 2c55afa commit 2ae3c47

9 files changed

Lines changed: 165 additions & 94 deletions

File tree

src/commands/folders/create.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,31 @@ a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c b
5050
const APIClient = await this.getAPIClient()
5151
const folder = await APIClient.createFolder(payload)
5252

53-
ux.table([folder], {
54-
id: {
55-
header: 'ID',
53+
ux.table(
54+
[folder],
55+
Object.fromEntries([
56+
[
57+
'id',
58+
{
59+
header: 'ID',
60+
},
61+
],
62+
['name', {}],
63+
[
64+
'parentFolderId',
65+
{
66+
header: 'Parent Folder ID',
67+
},
68+
],
69+
['color', {}],
70+
['description', {}],
71+
['icon', {}],
72+
]),
73+
{
74+
printLine: this.log.bind(this),
75+
...flags,
5676
},
57-
name: {},
58-
parentFolderId: {
59-
header: 'Parent Folder ID',
60-
},
61-
color: {},
62-
description: {},
63-
icon: {},
64-
}, {
65-
printLine: this.log.bind(this),
66-
...flags,
67-
})
77+
)
6878
} catch (error) {
6979
this.log('Create folder failed')
7080
this.error(error as Error)

src/commands/folders/index.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,31 @@ ID Color Description Icon Name
2424
const APIClient = await this.getAPIClient()
2525
const folders = flags.folderId ? [await APIClient.getFolder(flags.folderId)] : await APIClient.getFolderList()
2626

27-
ux.table(folders, {
28-
id: {
29-
header: 'ID',
27+
ux.table(
28+
folders,
29+
Object.fromEntries([
30+
[
31+
'id',
32+
{
33+
header: 'ID',
34+
},
35+
],
36+
['color', {}],
37+
['description', {}],
38+
['icon', {}],
39+
['name', {}],
40+
[
41+
'parentFolderId',
42+
{
43+
header: 'Parent Folder ID',
44+
},
45+
],
46+
]),
47+
{
48+
printLine: this.log.bind(this),
49+
...flags,
3050
},
31-
color: {},
32-
description: {},
33-
icon: {},
34-
name: {},
35-
parentFolderId: {
36-
header: 'Parent Folder ID',
37-
},
38-
}, {
39-
printLine: this.log.bind(this),
40-
...flags,
41-
})
51+
)
4252
} catch (error) {
4353
this.log('Fetch folders failed')
4454
this.error(error as Error)

src/commands/folders/order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Order extends HackMDCommand {
88
static description = 'Get or update folder order'
99
static examples = [
1010
'$ hackmd-cli folders order',
11-
`$ hackmd-cli folders order --order='{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}'`,
11+
'$ hackmd-cli folders order --order=\'{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}\'',
1212
]
1313
static flags = {
1414
help: Flags.help({char: 'h'}),

src/commands/folders/update.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,31 @@ a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c b
5151
const APIClient = await this.getAPIClient()
5252
const folder = await APIClient.updateFolder(folderId, payload)
5353

54-
ux.table([folder], {
55-
id: {
56-
header: 'ID',
54+
ux.table(
55+
[folder],
56+
Object.fromEntries([
57+
[
58+
'id',
59+
{
60+
header: 'ID',
61+
},
62+
],
63+
['name', {}],
64+
[
65+
'parentFolderId',
66+
{
67+
header: 'Parent Folder ID',
68+
},
69+
],
70+
['color', {}],
71+
['description', {}],
72+
['icon', {}],
73+
]),
74+
{
75+
printLine: this.log.bind(this),
76+
...flags,
5777
},
58-
name: {},
59-
parentFolderId: {
60-
header: 'Parent Folder ID',
61-
},
62-
color: {},
63-
description: {},
64-
icon: {},
65-
}, {
66-
printLine: this.log.bind(this),
67-
...flags,
68-
})
78+
)
6979
} catch (error) {
7080
this.log('Update folder failed')
7181
this.error(error as Error)

src/commands/team-folders/create.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,31 @@ a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e
5555
const APIClient = await this.getAPIClient()
5656
const folder = await APIClient.createTeamFolder(teamPath, payload)
5757

58-
ux.table([folder], {
59-
id: {
60-
header: 'ID',
58+
ux.table(
59+
[folder],
60+
Object.fromEntries([
61+
[
62+
'id',
63+
{
64+
header: 'ID',
65+
},
66+
],
67+
['name', {}],
68+
[
69+
'parentFolderId',
70+
{
71+
header: 'Parent Folder ID',
72+
},
73+
],
74+
['color', {}],
75+
['description', {}],
76+
['icon', {}],
77+
]),
78+
{
79+
printLine: this.log.bind(this),
80+
...flags,
6181
},
62-
name: {},
63-
parentFolderId: {
64-
header: 'Parent Folder ID',
65-
},
66-
color: {},
67-
description: {},
68-
icon: {},
69-
}, {
70-
printLine: this.log.bind(this),
71-
...flags,
72-
})
82+
)
7383
} catch (error) {
7484
this.log('Create team folder failed')
7585
this.error(error as Error)

src/commands/team-folders/index.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,31 @@ ID Color Description Icon Name Pare
2929
const APIClient = await this.getAPIClient()
3030
const folders = flags.folderId ? [await APIClient.getTeamFolder(flags.teamPath, flags.folderId)] : await APIClient.getTeamFolderList(flags.teamPath)
3131

32-
ux.table(folders, {
33-
id: {
34-
header: 'ID',
32+
ux.table(
33+
folders,
34+
Object.fromEntries([
35+
[
36+
'id',
37+
{
38+
header: 'ID',
39+
},
40+
],
41+
['color', {}],
42+
['description', {}],
43+
['icon', {}],
44+
['name', {}],
45+
[
46+
'parentFolderId',
47+
{
48+
header: 'Parent Folder ID',
49+
},
50+
],
51+
]),
52+
{
53+
printLine: this.log.bind(this),
54+
...flags,
3555
},
36-
color: {},
37-
description: {},
38-
icon: {},
39-
name: {},
40-
parentFolderId: {
41-
header: 'Parent Folder ID',
42-
},
43-
}, {
44-
printLine: this.log.bind(this),
45-
...flags,
46-
})
56+
)
4757
} catch (error) {
4858
this.log('Fetch team folders failed')
4959
this.error(error as Error)

src/commands/team-folders/order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Order extends HackMDCommand {
88
static description = 'Get or update team folder order'
99
static examples = [
1010
'$ hackmd-cli team-folders order --teamPath=CLI-test',
11-
`$ hackmd-cli team-folders order --teamPath=CLI-test --order='{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}'`,
11+
'$ hackmd-cli team-folders order --teamPath=CLI-test --order=\'{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}\'',
1212
]
1313
static flags = {
1414
help: Flags.help({char: 'h'}),

src/commands/team-folders/update.ts

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ import {
1616
export default class Update extends HackMDCommand {
1717
static description = 'Update team folder'
1818
static examples = [
19-
`$ hackmd-cli team-folders update --teamPath=CLI-test --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --name='team-docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=blue
20-
ID Name Parent Folder ID Color Description Icon
21-
──────────────────────────────────── ───────── ──────────────────────────────────── ───── ─────────── ─────
22-
a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c blue Docs 1F600`,
19+
[
20+
'$ hackmd-cli team-folders update --teamPath=CLI-test ',
21+
'--folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d ',
22+
"--name='team-docs' ",
23+
'--parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c ',
24+
"--description='Docs' --icon=1F600 --color=blue\n",
25+
'ID Name Parent Folder ID Color Description Icon\n',
26+
'──────────────────────────────────── ───────── ──────────────────────────────────── ───── ─────────── ─────\n',
27+
'a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c blue Docs 1F600',
28+
].join(''),
2329
]
2430
static flags = {
2531
color: folderColor,
@@ -57,21 +63,31 @@ a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e
5763
const APIClient = await this.getAPIClient()
5864
const folder = await APIClient.updateTeamFolder(teamPath, folderId, payload)
5965

60-
ux.table([folder], {
61-
id: {
62-
header: 'ID',
66+
ux.table(
67+
[folder],
68+
Object.fromEntries([
69+
[
70+
'id',
71+
{
72+
header: 'ID',
73+
},
74+
],
75+
['name', {}],
76+
[
77+
'parentFolderId',
78+
{
79+
header: 'Parent Folder ID',
80+
},
81+
],
82+
['color', {}],
83+
['description', {}],
84+
['icon', {}],
85+
]),
86+
{
87+
printLine: this.log.bind(this),
88+
...flags,
6389
},
64-
name: {},
65-
parentFolderId: {
66-
header: 'Parent Folder ID',
67-
},
68-
color: {},
69-
description: {},
70-
icon: {},
71-
}, {
72-
printLine: this.log.bind(this),
73-
...flags,
74-
})
90+
)
7591
} catch (error) {
7692
this.log('Update team folder failed')
7793
this.error(error as Error)

src/commands/team-notes/create.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ ID Title User Path T
1818
────────────────────── ──────────────────────────────── ────────────────────── ────────
1919
raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q null `,
2020

21-
`$ hackmd-cli team-notes create --teamPath=CLI-test --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled
22-
ID Title User Path Team Path
23-
────────────────────── ──────────────────────────────── ────────────────────── ────────
24-
raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q null `,
21+
[
22+
'$ hackmd-cli team-notes create --teamPath=CLI-test ',
23+
'--parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c ',
24+
"--content='# A new note' --readPermission=owner ",
25+
'--writePermission=owner --commentPermission=disabled\n',
26+
'ID Title User Path Team Path\n',
27+
'────────────────────── ──────────────────────────────── ────────────────────── ────────\n',
28+
'raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q null ',
29+
].join(''),
2530

2631
'Or you can pipe content via Unix pipeline:',
2732
'cat README.md | hackmd-cli team-notes create --teamPath=CLI-test',

0 commit comments

Comments
 (0)