jamesjuett / lobster

Interactive Program Visualization Tools
8 stars 3 forks source link

[enhancement] Add style format configuration file for this project #294

Open iteemhe opened 2 years ago

iteemhe commented 2 years ago

Can we have a standardized format configuration file for Prettier https://prettier.io/, a formatter for TS? It also has a VS Code extension. Besides, we can include it in this project by npm install --save-dev prettier.

I believe standardizing the format for this repo can help us make the source code more consistent, readable and maintainable. Also it can help future maintenance and development.

Here is my .prettierrc.toml, we can create one for this repo. https://prettier.io/docs/en/configuration.html is the official doc for configuration file.

printWidth = 80
tabWidth = 4
useTabs = false
semi = true
singleQuote = false
trailingComma = "es5"
iteemhe commented 2 years ago

And also, I want to propose to add the comment rules for this repo. I think the same style as Rust style will be helpful. https://doc.rust-lang.org/reference/comments.html is the Rust comment rules.

To highlight the syntax of such comments, we can use Better Comments extension in VS Code https://github.com/aaron-bond/better-comments. And it will be easier for us to generate documentation in the future.

Also, here is another project, that is more like Java Doc. https://typedoc.org/

jamesjuett commented 2 years ago

+1 to prettier or something similar.

I've used typedoc for another project and think it would work well for Lobster.