Skip to content

ssang/mobify-code-style

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobify Code Style

A repo to document code standards for different languages and provide tools for linting Mobify projects.

NPM version

JavaScript

Typically we lint our javascript files using Grunt. We have two javascript linters with different features. jshint and jscs.

To add javascript linting to your project:

  1. Install the NPM mobify-code-style, grunt-contrib-jshint, and grunt-contrib-jscs modules.
  2. Create a Gruntfile if you don't have one already.
  3. In the initConfig of your gruntfile, add sections for jshint and/or jscs pointing to the correct linting file.

Sample jshint config:

jshint:{
    dev: {
        src: ['src/**/*.js'],
        options: {
            // The task fails if force is set to false. With true, it shows the
            // linting errors, but continues
            force: false,
            jshintrc: 'node_modules/mobify-code-style/javascript/.jshintrc'
        }
    }
}

Sample jscs config:

jscs: {
    options: {
        config: 'node_modules/mobify-code-style/javascript/.jscsrc'
    },
    src: ['src/**/*.js']
}

CSS

Our Client Services team's CSS Style Guide. Written with a lot of tender care by @kpeatt and @jeffkamo.

About

A place to define coding style and standards

Resources

Stars

Watchers

Forks

Packages

No packages published