Open x-ji opened 6 years ago
We can use EditorConfig for consistent styling https://editorconfig.org/
I have no opinion on the matter and will happily adopt any solution that you consider best. (Ideally one that let’s me use Emacs.)
On 6. Sep 2018, at 10:02 , stelaseldano notifications@github.com wrote:
We can use EditorConfig for consistent styling https://editorconfig.org/
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Here is more info on how to use EditorConfig with Emacs - https://github.com/editorconfig/editorconfig-emacs#readme
The template repositories also use ESlint now so we can add rules for the indentation in the .eslintrc
@stelaseldano Hey I just wonder what tool you used for this set of formatting in commit https://github.com/babe-project/MinimalTemplate/commit/8bc1ff08c2fc2fdfd095195ac1d015ed14788df8. The formatting standards for JS is indeed messy. I now have Prettier plugin installed for VS Code, but it insists on not having any space between function name and parentheses. Guess I can also look at the plugin you used, so that we can arrive at a standard, or I'll just turn off Prettier in my editor.
@x-ji I used Beautify (https://github.com/brackets-beautify). I'm not sure it is available for VS Code (I think it is - https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify). I don't mind using Prettier instead.
@stelaseldano Thanks. Both Beautify and Prettier seem to be supported by most editors. I disabled Beautify previously but I just enabled it for the project. It should suffice for now. Prettier is a bit more opinionated but offers fewer configuration options: https://github.com/HookyQR/VSCodeBeautify/issues/201
Currently there seem to be some discrepancies in the code format, and every time I try to save a JS file some lines' indentations might be changed. It might help to have a consistent format standard, e.g. using a
.eslintrc
file: https://eslint.org/docs/rules/indent