Code Style and Cleanup
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I propose we keep the codebase clean by enhancing integration with the following tools:
- JSHint
- JSCS
- conventional changelog
- Editor Config
## JSHint
Right now jshint and conventional changelog are integrated with the project, but we have not been enforcing compliance with them.
Before you commit any JavaScript changes use the `gulp jshint` task, or while running the development server keep an eye out for any warnings produced by JSHint.
## JSCS
JSCS will help us keep a consistent code style throughout all our JavaScript files. This will have to be integrated into this project and possibly [gulp-begin](https://github.com/Beg-in/gulp-begin).
A good place to get some boilerplate rules would be [Bower](https://github.com/bower/bower/blob/master/.jscsrc)
Additional resources for JSCS:
- http://jscs.info/rules
- https://yannick.cr/posts/enforcing-coding-rules-in-your-team-with-jscs/post
## Conventional Changelog
gulp-begin comes with [Conventional Changelog](https://github.com/stevemao/gulp-conventional-changelog), and we should start following [Angular Conventional Commit Format](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)
## Editor Config
We should produce a `.editorconfig` file that will help our editors automatically conform to some of our code style preferences. [See the Editor Config homepage](http://editorconfig.org/).
## Additional Comments
I propose the following guidelines
- 4 spaces for indentation
- Single quotes for strings within JavaScript files
- `'use strict';` as the first line in all JavaScript files
You can use Google's [JavaScript Style Guide](https://google.github.io/styleguide/javascriptguide.xml) for help with general JavaScript design choices.
## TODO
- [ ] Documentation for a Contributing section with code style guidelines. Perhaps a `CONTRIBUTING.md` file.
- [ ] Addition of a JSCS task and config file
- [ ] Addition of a `.editorconfig` file
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the existing gulp jshint task and the project's current integration of JSHint and conventional changelog. Review the TODO items for a JSCS task and config, .editorconfig, and CONTRIBUTING.md, then compare the proposed style rules with the linked JSCS resources. Done means the requested tooling and configuration are added and the code-style guidance is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, documentation, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100