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

TypeScript style guide additions #1262

Closed
anton-trunov opened this issue Dec 26, 2024 · 0 comments · Fixed by #1264
Closed

TypeScript style guide additions #1262

anton-trunov opened this issue Dec 26, 2024 · 0 comments · Fixed by #1264
Assignees
Labels
internal-documentation Internal documentation of the Tact compiler and the repository. Not to be confused with docs/
Milestone

Comments

@anton-trunov
Copy link
Member

The TypeScript style guide was introduced in #1249 and #1250. Here are some additions/changes it could benefit from.

  • The style guide should be linked from README.md and/or the contributing guide.
  • The style guide's level one header should have "TypeScript" in it to avoid even brief confusion with Tact style guide we are supposed to come up with at some point.

Do

  • does not cover the switch statement; in many cases it can be replaced with makeVisitor from src/utils/tricks.ts, for a usage example see src/prettyPrinter.ts
  • simple types should perhaps include bigint as well?
  • "Don't use guard types x is T. These are just as in disguise. Might be used in very simple cases, such as ADT boilerplate." -- an example is needed

Don't

  • "Don't use optional fields foo?: Bar": needs alternative
  • "Don't use get and set. See Proxy above.": needs alternative
  • "Avoid exceptions. Exceptions are untyped.": needs alternative
@anton-trunov anton-trunov added the internal-documentation Internal documentation of the Tact compiler and the repository. Not to be confused with docs/ label Dec 26, 2024
@anton-trunov anton-trunov added this to the v1.6.0 milestone Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-documentation Internal documentation of the Tact compiler and the repository. Not to be confused with docs/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants