Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce standardjs #261

Closed
wants to merge 2 commits into from
Closed

Introduce standardjs #261

wants to merge 2 commits into from

Conversation

adaxi
Copy link

@adaxi adaxi commented Jan 8, 2018

I suggest adding standardjs for code formatting. Main reasons are described at https://standardjs.com/

  • No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
  • Automatically format code. Just run standard --fix and say goodbye to messy or inconsistent code.
  • Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor..

A git hook was added to ensure that the conventions are respected.

The changes in this merge request were mostly done by the --fix option of the standard tool.
Some linter exceptions were added to ensure no logic change in this merge request. In the future these exceptions should be removed and the underlying issues should be fixed:

Other than that == was used instead of === and some variables were re-declared in the same scope.

A git hook was added to ensure that the conventions are respected.
The work was mostly done by the --fix option of the 'standard' tool.
Some linter exceptions were added to ensure minimal changes to the code:
- Buffer.from should not be used anymore: standard/standard#693
- Errors were not handled in some cases
- Global variables: log, config ...
- callback(true) is not recommended: standard/standard#623

Other than that '==' was used instead of '===' and some variables were redeclared in the same scope.
@adaxi adaxi closed this Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant