Skip to content

Commit

Permalink
refactor: fallback as long as undefined is met
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Nov 19, 2024
1 parent 980e394 commit 1c200bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/source-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export default function sourceType(context: RuleContext) {
if (
'parserOptions' in context.languageOptions &&
context.languageOptions.parserOptions &&
'sourceType' in context.languageOptions.parserOptions
context.languageOptions.parserOptions.sourceType
) {
return context.languageOptions.parserOptions.sourceType
}
if ('sourceType' in context.languageOptions) {
if (context.languageOptions.sourceType) {
return context.languageOptions.sourceType
}
}
if ('sourceType' in context.parserOptions) {
if (context.parserOptions.sourceType) {
return context.parserOptions.sourceType
}
}

0 comments on commit 1c200bf

Please sign in to comment.