Skip to content

Commit da9cc9a

Browse files
committed
style: upgrade eslint deps and fix linting issues
1 parent 2bbb3f3 commit da9cc9a

28 files changed

+2128
-706
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import oclifConfig from 'eslint-config-oclif';
2+
3+
export default [
4+
...oclifConfig,
5+
{
6+
ignores: ['**/dist/**', '**/lib/**', '**/node_modules/**'],
7+
},
8+
{
9+
files: ['test/**/*.ts', 'test/**/*.js'],
10+
rules: {
11+
'@typescript-eslint/no-require-imports': 'off',
12+
'n/no-missing-require': 'off',
13+
'unicorn/prefer-module': 'off',
14+
},
15+
},
16+
];

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
"@types/node": "^24.0.0",
2828
"chai": "^4.2.0",
2929
"dotenv": "^8.2.0",
30-
"eslint": "7",
31-
"eslint-config-oclif": "^4.0.0",
32-
"eslint-config-oclif-typescript": "^1.0.3",
30+
"eslint": "^9.39.2",
31+
"eslint-config-oclif": "^6.0.130",
3332
"mocha": "^10.2.0",
3433
"nyc": "^13.3.0",
3534
"shx": "^0.3.4",
@@ -71,7 +70,7 @@
7170
"packageManager": "[email protected]",
7271
"scripts": {
7372
"build": "shx rm -rf dist && tsc -b",
74-
"lint": "eslint . --ext .ts --config .eslintrc",
73+
"lint": "eslint .",
7574
"postpack": "shx rm -f oclif.manifest.json",
7675
"posttest": "pnpm run lint",
7776
"prepack": "pnpm run build && oclif manifest && oclif readme",

pnpm-lock.yaml

Lines changed: 1985 additions & 553 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/export.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import {noteId} from '../flags'
55

66
export default class Export extends HackMDCommand {
77
static description = 'Export note content'
8-
98
static examples = [
109
`$ hackmd-cli export --noteId=kNFWV5E-Qz-QP7u6XnNvyQ
1110
# A note to be exported
1211
`,
1312
]
14-
1513
static flags = {
1614
help: Flags.help({char: 'h'}),
1715
noteId,

src/commands/history.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import HackMDCommand from '../command'
44

55
export default class History extends HackMDCommand {
66
static description = 'List user browse history'
7-
87
static examples = [
98
`$ hackmd-cli history
109
ID Title User Path Team Path
1110
────────────────────── ──────────────────────────────── ────────────────────── ────────
1211
raUuSTetT5uQbqQfLnz9lA CLI test note gvfz2UB5THiKABQJQnLs6Q null
1312
BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null CLI-test `,
1413
]
15-
1614
static flags = {
1715
help: Flags.help({char: 'h'}),
1816
...ux.table.flags(),
@@ -29,13 +27,13 @@ BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null C
2927
id: {
3028
header: 'ID',
3129
},
30+
teamPath: {
31+
header: 'Team Path',
32+
},
3233
title: {},
3334
userPath: {
3435
header: 'User Path',
3536
},
36-
teamPath: {
37-
header: 'Team Path',
38-
},
3937
}, {
4038
printLine: this.log.bind(this),
4139
...flags,

src/commands/login.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import HackMDCommand from '../command'
44

55
export default class Login extends HackMDCommand {
66
static description = 'Login to HackMD server from CLI'
7-
87
static examples = [
98
`$ hackmd-cli login
109
@@ -13,7 +12,6 @@ Enter your access token: MY_ACCESS_TOKEN
1312
Login successfully
1413
`,
1514
]
16-
1715
static flags = {
1816
help: Flags.help({char: 'h'}),
1917
}

src/commands/logout.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import {setAccessTokenConfig} from '../utils'
55

66
export default class Logout extends HackMDCommand {
77
static description = 'Login to HackMD server from CLI'
8-
98
static examples = [
109
`$ hackmd-cli logout
1110
1211
You've logged out successfully
1312
`,
1413
]
15-
1614
static flags = {
1715
help: Flags.help({char: 'h'}),
1816
}

src/commands/notes/create.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {safeStdinRead, temporaryMD} from '../../utils'
1919

2020
export default class CreateCommand extends HackMDCommand {
2121
static description = 'Create a note'
22-
2322
static examples = [
2423
"notes create --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled",
2524

@@ -30,15 +29,14 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
3029
'Or you can pipe content via Unix pipeline:',
3130
'cat README.md | hackmd-cli notes create',
3231
]
33-
3432
static flags = {
35-
help: Flags.help({char: 'h'}),
36-
title: noteTitle,
33+
commentPermission,
3734
content: noteContent,
35+
editor,
36+
help: Flags.help({char: 'h'}),
3837
readPermission: notePermission,
38+
title: noteTitle,
3939
writePermission: notePermission,
40-
commentPermission,
41-
editor,
4240
...ux.table.flags(),
4341
}
4442

@@ -47,11 +45,11 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
4745
const pipeString = safeStdinRead()
4846

4947
const options: CreateNoteOptions = {
50-
title: flags.title,
48+
commentPermission: flags.commentPermission as CommentPermissionType,
5149
content: pipeString || flags.content,
5250
readPermission: flags.readPermission as NotePermissionRole,
51+
title: flags.title,
5352
writePermission: flags.writePermission as NotePermissionRole,
54-
commentPermission: flags.commentPermission as CommentPermissionType,
5553
}
5654

5755
if (flags.editor) {
@@ -75,13 +73,13 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
7573
id: {
7674
header: 'ID',
7775
},
76+
teamPath: {
77+
header: 'Team path',
78+
},
7879
title: {},
7980
userPath: {
8081
header: 'User path',
8182
},
82-
teamPath: {
83-
header: 'Team path',
84-
},
8583
},
8684
{
8785
printLine: this.log.bind(this),

0 commit comments

Comments
 (0)