Skip to content

Commit

Permalink
avoid syntax error in .d.ts when the module names end up long (#273)
Browse files Browse the repository at this point in the history
It is not legal typescript to wrap a `declare module "foo/bar" {` statement - this is a SyntaxError.  as such, we need to `self.emit()` this statement instead of `self.emit_wrapped_text()`.
  • Loading branch information
dgoldstein0 committed Mar 30, 2022
1 parent 9600065 commit bdd49bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stone/backends/tsd_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def _generate_types(self, namespace, spaces_per_indent, extra_args):
if namespace.doc:
self._emit_tsdoc_header(namespace.doc)

self.emit_wrapped_text(self._get_top_level_declaration(namespace.name))
self.emit(self._get_top_level_declaration(namespace.name))

with self.indent(dent=spaces_per_indent):
for data_type in data_types:
Expand Down

0 comments on commit bdd49bc

Please sign in to comment.