twinstone / tdi

Turbocharged DOM Infusion
Apache License 2.0
6 stars 1 forks source link

Coding style spec #24

Closed mishal closed 7 years ago

mishal commented 7 years ago

What coding style does TDI use?

Could it be reformatted using any well known one so eslint or another tool can be used to check the source?

centi commented 7 years ago

Hi. There is no particular coding style used. Which one do you suggest?

mishal commented 7 years ago

Google style: https://google.github.io/styleguide/jsguide.html ?

There is a nice preset for Eslint: http://eslint.org/docs/user-guide/migrating-from-jscs#converting-presets which makes the linting easy.

We use additional rules for:

centi commented 7 years ago

Space indentation is a no-go for me. I will check other guides.

mishal commented 7 years ago

You can simply extend the existing styles and customize it to fit your preferences: use tab instead space.

centi commented 7 years ago

I know. There is a new branch called "style-guide", where I added some jshint and jscs rules (based on Airbnb style guide) and reformatted the code accordingly.

centi commented 7 years ago

Do you have a windows machine available? I added a pre-commit git hook, which runs the tests and linting, but I have only a Mac with me. I would like to know, if the hook runs ok on Windows (after checking out the branch, you need to run npm install again).

mishal commented 7 years ago

Hi in 2017! :)

The hook works ok on my win machine. (Win 7 Pro)!

I propose to run the linting tests also on Travis.