Skip to content

Commit

Permalink
chore: make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Nov 19, 2024
1 parent 43fef86 commit 5e8fecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/config/flat/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export default {
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
}
},
},
} satisfies PluginFlatBaseConfig
10 changes: 6 additions & 4 deletions src/utils/source-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export default function sourceType(context: RuleContext) {
if ('sourceType' in context.languageOptions) {
return context.languageOptions.sourceType
}
if ('parserOptions' in context.languageOptions && context.languageOptions.parserOptions) {
if ('sourceType' in context.languageOptions.parserOptions) {
return context.languageOptions.parserOptions.sourceType
}
if (
'parserOptions' in context.languageOptions &&
context.languageOptions.parserOptions &&
'sourceType' in context.languageOptions.parserOptions
) {
return context.languageOptions.parserOptions.sourceType
}
return context.languageOptions.sourceType
}
Expand Down

0 comments on commit 5e8fecb

Please sign in to comment.