All Projects → pagarme → Javascript Style Guide

pagarme / Javascript Style Guide

Licence: mit
🎨 Javascript styleguide followed by us here at Pagar.me

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Javascript Style Guide

Javascript
JavaScript Style Guide
Stars: ✭ 117,286 (+239259.18%)
Mutual labels:  eslint, styleguide
Nodebestpractices
✅ The Node.js best practices list (December 2021)
Stars: ✭ 72,734 (+148336.73%)
Mutual labels:  eslint, styleguide
Javascript Style Guide
Airbnb JavaScript 스타일 가이드
Stars: ✭ 132 (+169.39%)
Mutual labels:  eslint, styleguide
Javascript Airbnb
Перевод «JavaScript Style Guide» от Airbnb
Stars: ✭ 579 (+1081.63%)
Mutual labels:  eslint, styleguide
Sqlstyle.guide
A consistent code style guide for SQL to ensure legible and maintainable projects
Stars: ✭ 994 (+1928.57%)
Mutual labels:  styleguide
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-34.69%)
Mutual labels:  eslint
Eslint Import Resolver Jest
🃏 Jest import resolution plugin for eslint-plugin-import
Stars: ✭ 29 (-40.82%)
Mutual labels:  eslint
Eslint Plugin Security Node
ESLint security plugin for Node.js
Stars: ✭ 28 (-42.86%)
Mutual labels:  eslint
Eslint Module
ESLint module for Nuxt.js
Stars: ✭ 49 (+0%)
Mutual labels:  eslint
Gatsby Starter Strict
A Gatsby starter with strict linting and auto-formatting rules.
Stars: ✭ 43 (-12.24%)
Mutual labels:  eslint
Generator Fountain Webapp
Yeoman 'fountain' generator to start a webapp
Stars: ✭ 985 (+1910.2%)
Mutual labels:  eslint
React Starter
React Starter repository: cache bursting, css extraction, production, hot, react, redux, router, babel, eslint, jsx, webpack 3, editorconfig
Stars: ✭ 33 (-32.65%)
Mutual labels:  eslint
Quantum
The default pack of components and layout principles that dictates Catho Frontend applications.
Stars: ✭ 39 (-20.41%)
Mutual labels:  styleguide
Ale Sensible
Pretty, responsive and smooth defaults for a sane ALE, gets you started in 30 seconds
Stars: ✭ 30 (-38.78%)
Mutual labels:  eslint
Webgl Structure
🚀 A modern, ES6 based, javascript structure for WebGL based projects with THREE.js!
Stars: ✭ 44 (-10.2%)
Mutual labels:  eslint
Vue Eslint Demo
The online demo to check `eslint-plugin-vue`.
Stars: ✭ 29 (-40.82%)
Mutual labels:  eslint
Swift Style Guide
Swift language style guide & coding conventions followed by Xmartlabs.
Stars: ✭ 36 (-26.53%)
Mutual labels:  styleguide
Javascript Eslint.tmbundle
Integrates the ESLint JavaScript validator with TextMate 2
Stars: ✭ 41 (-16.33%)
Mutual labels:  eslint
Html Sass Babel Webpack Boilerplate
Webpack 4 + Babel + ES6 + SASS + HTML Modules + Livereload
Stars: ✭ 35 (-28.57%)
Mutual labels:  eslint
Eslint Plugin Wc
ESLint rules for Web Components
Stars: ✭ 35 (-28.57%)
Mutual labels:  eslint

Pagar.me JavaScript Style Guide

Our style guide is based on Airbnb's. Differences between them are described below.


Installing

The rules described in this repository are also available as a eslint config package. To install the package and its dependencies:

$ npm install --save-dev [email protected] \
                         [email protected] \
                         eslint-config-pagarme-base

The peer dependencies specified above have hardcoded versions. If you prefer you can use the command npm info [email protected] peerDependencies to find the exact peer dependencies to install.

To include in the project, create an .eslintrc file with at least the following contents:

{
  "extends": ["pagarme-base"]
}

Rules

Semicolons

Do not use semicolons.

Space before function paren

Wrong:

function transaction(amount) {

}

Right:

function transaction (amount) {

}

Linebreaks inside function parentheses

Wrong:

transaction(amount,
  installments)

Right:

transaction(
  amount,
  installments
)

Comma dangle always on multiline except on functions

Wrong:

const array = [1, 2, 3,]

Right:

const array = [1, 2, 3]

Wrong:

const array = [
  1,
  2,
  3
]

Right:

const array = [
  1,
  2,
  3,
]

Wrong:

const obj = {
  a: 1,
  b: 2,
  c: 3
}

Right:

const obj = {
  a: 1,
  b: 2,
  c: 3,
}

Dangling comma may cause weird errors when used on functions, you should avoid it.

Wrong:

Object.assign(
  {},
  b,
  c,
)

Right:

Object.assign(
  {},
  b,
  c
)

Maximum Line Length

Avoid having lines of code that are longer than 80 characters (including whitespace).

Maximum params in function definition

A function should have no more than 3 parameters. Consider using an options object parameter if you need to pass in more values to a function.

Multiple Empty Lines

Disallow the use of 2+ empty lines in the middle of the code.

Wrong:

const a = 'This is a test'


console.log(a)

Right:

const a = 'This is a test'

console.log(a)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].