Language Style Guides should be respected

I propose that all contributors should follow the same style guide for the languages we are using.

It is not difficult with the help of an IDE.

Typescript

There is no official style guide from Microsoft Typescript, but the airbnb javascript style guide seems to be a reference in javascript.

I found a fork of it, so a non official Typescript Style Guide.

There is a tslint.json which can be used by installing the tslint nodejs module.

My PyCharm IDE is using the tslint module, and follow the rules of the tslint.json config.

Python

Python get the famous PEP8.

My PyCharm IDE has this style guide built-in, so there is nothing to install.

Duniter-python-api does not respect PEP8, but Silkaj does ! :wink:

Rust

I found this official Style Guide RFC.

Verify that your IDE is aware of it.


Feel free to comment, and may be propose better Style Guides, so we can decide which one to follow.

2 Likes

Yes in Rust it’s magical, we even have a program that automatically normalizes the style of our code (fmt), I tested it, it’s super powerful :grinning:

3 Likes

I propose to install the module tslint in Duniter node-module with yarn.

yarn install tslint

this will update those files :

package.json
yarn.lock

Then put the tslint.son in the root folder of the project.

Why ?

Duniter will force contributors with a compatible IDE to follow the same rules, by shipping the rules with the project.

For VSCODE :

3 Likes