Skip to content

Commit f62f89e

Browse files
committed
fix(export-map): fix hashing for parser
1 parent 96bf9ba commit f62f89e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/utils/export-map.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,20 +1134,23 @@ function makeContextCacheKey(context: RuleContext | ChildContext) {
11341134

11351135
let hash = getOptionsHash('settings', settings)
11361136

1137-
const usedParserOptions = languageOptions
1138-
? languageOptions.parserOptions
1139-
: parserOptions
1137+
const usedParserOptions = languageOptions?.parserOptions ?? parserOptions
11401138

11411139
hash += getOptionsHash('parserOptions', usedParserOptions)
11421140

11431141
if (languageOptions) {
1144-
const { parser: { meta } = {}, ecmaVersion, sourceType } = languageOptions
1145-
hash +=
1146-
getOptionsHash('parserMeta', meta) +
1147-
String(ecmaVersion) +
1148-
String(sourceType)
1142+
const { ecmaVersion, sourceType } = languageOptions
1143+
hash += String(ecmaVersion) + String(sourceType)
1144+
}
1145+
1146+
if (parserPath) {
1147+
hash += parserPath
11491148
} else {
1150-
hash += String(parserPath)
1149+
const { meta } = languageOptions?.parser ?? {}
1150+
1151+
if (meta) {
1152+
hash += getOptionsHash('parserMeta', meta)
1153+
}
11511154
}
11521155

11531156
return hash

0 commit comments

Comments
 (0)