Skip to content

Commit f1c5923

Browse files
committed
chore: update
1 parent 3d7f91c commit f1c5923

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/processor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ interface GroupState {
1111
}
1212

1313
export default {
14-
preprocess(code: string) {
14+
preprocess(code: string): string[] {
1515
return [code]
1616
},
1717

18-
postprocess(messages: LintMessage[][]) {
18+
postprocess(messages: LintMessage[][]): LintMessage[] {
1919
const state = {
2020
block: {
2121
disableAllKeys: new Set<string>(),
2222
disableRuleKeys: new Map<string, string[]>()
23-
} as GroupState,
23+
} satisfies GroupState,
2424
line: {
2525
disableAllKeys: new Set<string>(),
2626
disableRuleKeys: new Map<string, string[]>()
27-
} as GroupState
27+
} satisfies GroupState
2828
}
2929
const usedDisableDirectiveKeys: string[] = []
3030
const unusedDisableDirectiveReports = new Map<string, LintMessage>()
@@ -132,7 +132,7 @@ function addDisableRule(
132132
disableRuleKeys: GroupState['disableRuleKeys'],
133133
rule: string,
134134
key: string
135-
) {
135+
): void {
136136
let keys = disableRuleKeys.get(rule)
137137
if (keys) {
138138
keys.push(key)
@@ -142,7 +142,7 @@ function addDisableRule(
142142
}
143143
}
144144

145-
function messageToKey(message: LintMessage) {
145+
function messageToKey(message: LintMessage): string {
146146
return `line:${message.line},column${
147147
// -1 because +1 by ESLint's `report-translator`.
148148
message.column - 1
@@ -156,6 +156,6 @@ function messageToKey(message: LintMessage) {
156156
* @returns A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
157157
* itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
158158
*/
159-
function compareLocations(itemA: Position, itemB: Position) {
159+
function compareLocations(itemA: Position, itemB: Position): number {
160160
return itemA.line - itemB.line || itemA.column - itemB.column
161161
}

tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default defineConfig({
66
format: ['cjs'],
77
copy: ['lib/index.d.ts'],
88
dts: false,
9-
external: ['typescriopt'],
9+
external: ['typescript'],
1010
unbundle: true
1111
})

0 commit comments

Comments
 (0)