TypeScript formatting
See original GitHub issueWe 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 thebuild: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:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not a problem. I’ll look into using tslint.
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.