Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class export is called export= #1572

Closed
hiimjustin000 opened this issue Apr 18, 2021 · 4 comments
Closed

class export is called export= #1572

hiimjustin000 opened this issue Apr 18, 2021 · 4 comments
Labels
bug Functionality does not match expectation no bug This is expected behavior

Comments

@hiimjustin000
Copy link

hiimjustin000 commented Apr 18, 2021

Search terms

export, export=

Expected Behavior

The class would be correctly named (In this case, Licenses)

Actual Behavior

The class is called export=

Steps to reproduce the bug

https://github.com/bwbjustin/bwbjustin.github.io
https://github.com/bwbjustin/github-licenses

Environment

  • Typedoc version: 0.20.35
  • TypeScript version: 4.2.4
  • Node.js version: 14.16.0
  • OS: Windows 10
@hiimjustin000 hiimjustin000 added the bug Functionality does not match expectation label Apr 18, 2021
@Gerrit0 Gerrit0 added the no bug This is expected behavior label Apr 18, 2021
@hiimjustin000
Copy link
Author

How is this not a bug? What behavior causes this?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 18, 2021

(I was looking for a canonical issue, but apparently don't really have one...)

This is expected behavior. export = Licenses does not create an export named Licenses, export class Licenses would, or export { Licenses } would. export = creates a module whose export is the value.

If I read docs for a modern library and see that Licenses is exported, then I expect to do import { Licenses } from "github-licenses".

I provided an example plugin for renaming default exports, I suspect something very similar could be done here.


Sidenote: Why is this a class? It's all static methods... Why not just export a bunch of functions using ES module exports?

@hiimjustin000
Copy link
Author

Ok, on that.

@felipecrs
Copy link

felipecrs commented Aug 8, 2021

This is now handled by version 0.3.0 of typedoc-plugin-rename-defaults thanks to felipecrs/typedoc-plugin-rename-defaults#1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

3 participants