threat-dragon icon indicating copy to clipboard operation
threat-dragon copied to clipboard

Formatting Guidelines for Contributors

Open ShubhamPalriwala opened this issue 3 years ago • 2 comments

Describe what problem your feature request solves Every developer has their own set of configs for tab sizes, indentations, linters, etc. This makes reviewing a PR difficult as well as makes the code formatting non-uniform across the project.

Describe the solution you'd like Threat Dragon should have generalised standards that our project throughout its file follows. This reduces the time to address formatting changes and improves code readability also!

Open to discussion for the above-discussed standards. Once we agree on something, one can open a PR that implements the configs and sets up the entire project with those linting changes and uniformity.

ShubhamPalriwala avatar Feb 09 '22 21:02 ShubhamPalriwala

Just leaving some notes:

Off the top of my head (I will try to remember to check later today) - We have eslint configured for both td.vue and td.server, with different linting rules. Ideally, it'd be great to have a single source of truth. Both linters are configured to run with the --fix argument which should be able to handle simple formatting issues.

Another tool at our disposal is using a .gitattributes file to specify line endings, and I think can manage tabs v spaces as well.

lreading avatar Feb 09 '22 21:02 lreading

Thought about adopting JavaScript Standard Style, but it is a bit too brutal for us - mainly the dropping of (strictly) unnecessary semi-colons ... but these aid readability for people like me who are not out-and-out javascript developers

I have used standard to provide some suggestions to clean up our src trees but kept eslint

jgadsden avatar Sep 24 '22 18:09 jgadsden