• This repository has been archived on 09/Aug/2023
  • Stars
    star
    117
  • Rank 301,761 (Top 6 %)
  • Language
    Python
  • Created over 10 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“š Mobify's coding style and standards!

Mobify Code Style

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

NPM version CircleCI

JavaScript (ES5) with Grunt

Typically, we lint our javascript files using Grunt and grunt-eslint. grunt-eslint is a Grunt helper for the ESLint linter.

To add javascript linting to your project:

  1. Install the NPM mobify-code-style and grunt-eslint modules.
  2. Create a Gruntfile if you don't have one already.
  3. Create an .eslintrc.yml file in the root of your project directory
  4. In the initConfig of your gruntfile, add a section for eslint pointing to the correct linting file.

The .eslintrc.yml file should contain, to begin with:

extends:
  - './node_modules/mobify-code-style/es5/mobify-es5.yml'

Sample eslint Grunt config:

eslint:{
    dev: {
        src: ['src/**/*.js'],
        options: {
            // When true, eslint will test _only_ the rules set in the provided
            // configuration file
            reset: false,
            configFile: './.eslintrc.yml'
        }
    }
}

Migrating from ESLint 0.x or 1.x to ESlint 2.x or 3.x

If you upgrade the version of grunt-eslint you use from one that pulls in ESLint 1.x or lower to one that pulls in ESLint 2.x or greater, you must modify the configuration files to include the new style of configuration.

If the Grunt config includes the default config ./node_modules/mobify-code-style/javascript/.eslintrc, replace that with ./.eslintrc.yml, and add an .eslintrc.yml to the project root as described above.

If there are modifications to the lint configuration in the project, please check the migration guides at eslint.org to port the modified lint config to ESLint 3.x.

ES6/JSX

We use ESLint to lint ES6 and React/JSX code. If ESLint is installed in a project, we can use the configuration from this module by creating a file in the project root named .eslintrc.yml. If the project does not use JSX, the file contents should be

extends:
  - './node_modules/mobify-code-style/es6/mobify-es6.yml'

and for a React/JSX project:

extends:
  - './node_modules/mobify-code-style/es6/mobify-es6-react.yml'

If using a custom Webpack configuration, add the lines:

settings:
  import/resolver:
    webpack:
      config: '<path-to-webpack-config>'

to the .eslintrc.yml

Make sure to install the following NPM modules:

  • eslint > 3.0
  • eslint-plugin-import
  • eslint-import-resolver-webpack
  • eslint-plugin-react (for React/JSX linting only)

ESLint and Atom

Find out how to integrate ESLint and Atom Text.

CSS

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

Python

See the python directory of this repo for a standardized pylintrc file and instructions on using pep8, pylint and pyflakes to check Python code.

Documentation

See the docs directory for setup and configuration of Markdown linting.

Copyright Headers

All Mobify source files should contain copyright headers at the beginning of the file.

See the copyright directory for setup and configuration of the copyright manager tool

More Repositories

1

mobifyjs

Mobify.js was a JavaScript framework for optimizing sites for mobile. It is no longer actively maintained.
JavaScript
646
star
2

pikabu

Off-Canvas flyout menu
HTML
453
star
3

iterstuff

Useful tools for working with iterators
Python
169
star
4

bellows

A responsive, mobile-first accordion UI module for progressive disclosure on the web.
JavaScript
140
star
5

branching-strategy

πŸ”€ Branching strategies! For Git!
135
star
6

scooch

A mobile-first JavaScript-driven content and image carousel
JavaScript
125
star
7

handbooks

A collection of Mobify's internal handbooks and styleguides
90
star
8

developer-values

πŸ™Œ Principles to follow when building software.
76
star
9

commercecloud-ocapi-client

Salesforce Commerce Cloud Open Commerce API (OCAPI) for Node and browsers πŸ›’
JavaScript
70
star
10

nightwatch-commands

A set of Mobify specific custom commands for Nightwatch.js
JavaScript
60
star
11

magnifik

An image zooming module for mobile
JavaScript
54
star
12

sass-sleuth

Adapts Webkit Web Inspector to handle Sass line number debugging information
36
star
13

mobify-client

Mobify CLI and Tools for use with the Mobify.js Adaptation Framework
JavaScript
23
star
14

pinny

A mobile-first content fly-in UI plugin
JavaScript
23
star
15

mobify-modules

DEPRECATED! See https://github.com/mobify/mobify.github.io
CSS
23
star
16

meowbify

🐈 Meowbify
CoffeeScript
17
star
17

mobifyjs-demos

Demo mobile sites created using Mobify.js
JavaScript
15
star
18

hijax

XHR Proxy to intercept AJAX calls independent of libraries.
JavaScript
13
star
19

spline

⚠️ DEPRECATED. Spline is a mixin and function library for Sass. It makes writing stylesheets for mobile-first builds faster and easier. Spline provides methods to manipulate text, use web & icon fonts, create CSS3 shapes, and much more.
CSS
11
star
20

ui-kit

πŸ“± Quickly and efficiently design PWAs for ecommerce brands.
10
star
21

hybris-occ-client

πŸ› Hybris Omni Commerce Connect (OCC) client for Node and browsers.
HTML
9
star
22

capturejs

Transform your DOM to be your API for your front-end application
JavaScript
9
star
23

mobify-data-guide

πŸ“š List of readings that would be useful in getting started on with working with any data set.
7
star
24

vellum

Default project styles for a mobile-first AdaptiveJS build.
HTML
5
star
25

redux-runtypes-schema

Redux store validation via runtypes
TypeScript
5
star
26

deckard

Device OS and Browser detection
HTML
5
star
27

astro-scaffold

πŸ— Starting point for building Astro applications!
JavaScript
4
star
28

split-test

An A/B split test library for persisting split choices
JavaScript
4
star
29

stencil

DEPRECIATED - The latest Stencil development is currently taking place in the Adaptive.js repo.
CSS
4
star
30

imageresize-client

Client code for the Mobify image resizing API
HTML
4
star
31

hora.js

Hora.js: Custom Google Analytics Tracking
HTML
3
star
32

lockup

A mobile first scroll blocking plugin.
HTML
3
star
33

navitron

A mobile optimized sliding navigation plugin.
JavaScript
3
star
34

tozee

Alphabet scroll jumping
HTML
3
star
35

python-appfigures

API wrapper for the appfigures.com
Python
3
star
36

webpush-payload-encryption

Python code to handle the encryption of push notifications for Firefox and Chrome
Python
3
star
37

calypso

A set of tools for better Docker deployments to AWS Elastic Beanstalk.
Python
3
star
38

multiple-service-workers

Experimenting with multiple service workers
HTML
2
star
39

shade

A mobile-first plugin for creating scroll and touch blocking overlays for content
JavaScript
2
star
40

jazzcat-client

Client code for Mobify's javascript optimization service
JavaScript
2
star
41

level

⚠️ DEPRECATED. CST's own personal Normalize
CSS
2
star
42

styleandclass-planning

Style & Class Meetup Public Site
2
star
43

css-optimize

The client-library for optimizing CSS using the Jazzcat service
JavaScript
2
star
44

webpayments-test

πŸ’³ PaymentRequest browser API demo.
JavaScript
2
star
45

schemer

Schema comparison tool for Adaptive projects
JavaScript
2
star
46

dmit

Wrap docker-machine in useful functionality
Shell
2
star
47

descript

Manage desktop scripts in a simple way in Adaptive.js
HTML
2
star
48

heroku-buildpack-openssl

Buildpack for OpenSSL 1.0.2e on Heroku
Shell
2
star
49

selector-utils

Selector utility functions that can be selectively included in your Adaptive.js builds.
JavaScript
1
star
50

generator-nightwatch

A yeoman generator for Nightwatch testing framework
JavaScript
1
star
51

deprecated-mobify-tech-prtnr-na03-dw

The Demandware Demonstration Integration
CSS
1
star
52

stencil-fancy-select

A fancier select replacement component using Javascript
CSS
1
star
53

generator-progressive-web

❗️DEPRECATED❗️-- Generator for creating Progressive Web projects
Shell
1
star
54

adaptivejs-split-test-examples

Split test examples for Adaptive.js!
JavaScript
1
star
55

depot

A collection of mobile-focused lo-fi wireframe components built in Photoshop.
1
star
56

stencil-tabs

JavaScript
1
star