MercadoLibre JavaScript Style Guide
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
es5
.eslintrc
.gitignore
.npmrc
README.md
globals.js
license
package.json

README.md

JavaScript Style Guide

The previous version is available at old.

ES5

The rules for linting JavaScript es5 are based on those from AirBnB (for the deprecated version es5). From there, we’ve made some modifications to add our own custom set of rules, which are listed below.

Our final .eslintrc reflect this.

Table of Contents

  1. Indent
  2. Line max length
  3. Function names
  4. Parameters reassignment

Indent

  • We use an indentation of 4 spaces, instead of 2 as AirBnB.

⬆ back to top

Line max length

  • The limit for each line of code is set at 120 characters. It will produce an error if the limit is surpassed.

⬆ back to top

Function names

  • We have disabled the func-names rule from AirBnB.
  • We allow anonymous functions.

⬆ back to top

Parameters reassignment

  • We have disabled the no-param-reassign rule from AirBnB.
  • We allow the reassignment of parameters.

⬆ back to top

Contribute

References