Skip to content

Commit

Permalink
chore: fix types portability
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 25, 2023
1 parent 4044a64 commit 6fd2cdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export function renameRules(rules: Record<string, any>, from: string, to: string
const rulesOn = new Set<string>()
const rulesOff = new Set<string>()

export function recordRulesStateConfigs(configs: FlatESLintConfigItem[]) {
export function recordRulesStateConfigs(configs: FlatESLintConfigItem[]): FlatESLintConfigItem[] {
for (const config of configs)
recordRulesState(config.rules ?? {})

return configs
}

export function recordRulesState(rules: FlatESLintConfigItem['rules']) {
export function recordRulesState(rules: FlatESLintConfigItem['rules']): FlatESLintConfigItem['rules'] {
for (const [key, value] of Object.entries(rules ?? {})) {
const firstValue = Array.isArray(value) ? value[0] : value
if (firstValue == null)
Expand Down

0 comments on commit 6fd2cdd

Please sign in to comment.