Skip to content

Latest commit

 

History

History
72 lines (63 loc) · 1.06 KB

README.md

File metadata and controls

72 lines (63 loc) · 1.06 KB

#CoffeeScript Style Guide

This Style Guide is based on this one

Custom linter rules

Differences from the default CoffeeScript linter are

{
  "arrow_spacing": {
    "level": "warn"
  },
  "no_trailing_whitespace": {
    "level": "warn"
  },
  "max_line_length": {
    "value": 120,
    "level": "warn"
  },
  "indentation": {
    "value": 4
  },
  "colon_assignment_spacing": {
    level: "ignore",
  },
  "no_empty_param_list": {
    "level": "warn"
  },
  "space_operators": {
    "level": "warn"
  }
}

How to use in a project

Add as a dev dependency

npm i --dev @ttab/coffeescript-style

or

yarn add -D @ttab/coffeescript-style

Add a local coffeelint.json file in the root folder on your project that extends this linter config

{
    "extends": "@ttab/coffeescript-style"
}

Add a script in package.json

"scripts": {
    "lint": "coffeelint ./**/*.coffee",
}

Run the linter with

npm run lint

or

yarn lint