Skip to content

Commit

Permalink
Don't warn on moduleSuffixes when an empty string is passed (#16332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Jan 12, 2025
1 parent 2bc70df commit f9de8be
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/resolver/tsconfig_json.zig
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,18 @@ pub const TSConfigJSON = struct {
}

if (compiler_opts.expr.asProperty("moduleSuffixes")) |prefixes| {
if (!source.path.isNodeModule()) {
log.addWarning(&source, prefixes.expr.loc, "moduleSuffixes is not supported yet") catch {};
if (!source.path.isNodeModule()) handle_module_prefixes: {
var array = prefixes.expr.asArray() orelse break :handle_module_prefixes;
while (array.next()) |*element| {
if (element.asString(allocator)) |str| {
if (str.len > 0) {
// Only warn when there is actually content
// Sometimes, people do "moduleSuffixes": [""]
log.addWarning(&source, prefixes.loc, "moduleSuffixes is not supported yet") catch {};
break :handle_module_prefixes;
}
}
}
}
}

Expand Down

0 comments on commit f9de8be

Please sign in to comment.