Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

CodingFlow

it always good to have some standardized coding rules

Target

use jshint, JSHint and .etc to create auto checker based on these rules

indentation 2 spaces indentation type tab

javascript

  • refer to usejsdoc
  • put 'use strict'; on top.
  • use single qoute for string.
  • function brackets put as the sample below.
  • no restrict on having space after =
  • use flow to check javascript input type, (more details).
/**
 * @flow
 * @param {Object} arg1 - user credentials.
 * @param {boolean} arg2 - login for 1 month.
 * @return boolean
 */
function test(arg1, arg2) {
  var string = 'test string'; // sample of string defination
  var username = arg1.username,
      password = arg1.password;
  var login=
    that.login(username, password, function(data){
      return data.result;
    });
  return login;
}

sql

  • no "..." + "..." allowed in code when writing sql statement

About

it always good to have a standardized the coding rules

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors