question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript formatting

See original GitHub issue

We could improve the TypeScript quality of code by having a clang format. The clang-format tslint tool could standardize the format automagically:

  • We can set the clang style for line length, style guide (like Google’s style guide or Mozilla’s style guide for JavaScript)
  • Add to the build:src step to autoformat code
  • Add test to check the format in step in travis tests

So here are some of the good things that come out of it, it will notify the developer to:

  • Remove trailing spaces
  • Use a standard indentation
  • Style format from developer to developer is consistent
  • Makes an attempt to stay within a column space (I usually leave this at 100 col)
  • Catch missing semicolons;

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cnishinacommented, Oct 12, 2017

Not a problem. I’ll look into using tslint.

1reaction
pbugnioncommented, Oct 12, 2017

While I think that adopting a convention for laying out both Python and JS code is good, I am very wary of code auto-formatters that reformat your code on build. I personally would prefer to use tslint. Beyond personal preferences, I note that this is what JupyterLab uses.

If we run the linting as part of the Travis tests, we could guarantee the quality of code going into the repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript Programming with Visual Studio Code
Formatting. VS Code includes a TypeScript formatter that provides basic code formatting with reasonable defaults. Use the typescript.format.
Read more >
How to use Prettier with ESLint and TypeScript in VSCode
Decide on the formatting configuration that best suits your style; Configure Prettier to work with ESLint. Prerequisites. A code editor ...
Read more >
TypeScript Formatter online to format TS code. - Code Beautify
TypeScript Formatter is easy to use tool to beautify TS code. Copy, Paste, and Format. What can you do with TS Code Formatter?...
Read more >
Prettier · Opinionated Code Formatter
What is Prettier? An opinionated code formatter; Supports many languages; Integrates with most editors; Has few options ...
Read more >
Linting in TypeScript using ESLint and Prettier - LogRocket Blog
Having a formatting tool, a linting tool, and TypeScript helps us automate this process. In this article, we'll use ESLint and TypeScript, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found