Jump to content

Not a bug report, but a note about code conventions


dimous
 Share

Recommended Posts

Hello!

I'm logged in on github, but for some reason can't access "issues" tab, therefore I'm writing it here.

Some private members became public, but still prefixed with underscore, for example - https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L296. It's not that important, I know, but I'm cringing seeing this, lol. I belive, it's good to strictly follow code conventions.

Thank you for attention.

Link to comment
Share on other sites

2 hours ago, Deltakosh said:

Hello!

this is on purpose as there is no "internal" keyword support on TypeScript

Actually there is. See the "--stripInternal" compiler option here: https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Compiler%20Options.md
I didn't tested it on propeties yet but i'm using it in my library to hide internal methods. They are not part of the .d.ts this way.
But i also use the underscore prefix for public internal members.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...