Skip to content

Commit

Permalink
chore: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Nov 20, 2024
1 parent e1f91c4 commit 123cce4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,8 @@ export function parse(
parserOptions = withoutProjectParserOptions(parserOptions)

// If this is a flat config, we need to add ecmaVersion and sourceType (if present) from languageOptions
if (
parserOptions.ecmaVersion == null &&
context.languageOptions?.ecmaVersion
) {
parserOptions.ecmaVersion = context.languageOptions.ecmaVersion
}
if (parserOptions.sourceType == null && context.languageOptions?.sourceType) {
parserOptions.sourceType = context.languageOptions.sourceType
}
parserOptions.ecmaVersion ??= context.languageOptions?.ecmaVersion
parserOptions.sourceType ??= context.languageOptions?.sourceType

// require the parser relative to the main module (i.e., ESLint)
const parser =
Expand Down

0 comments on commit 123cce4

Please sign in to comment.