eslint-config-madecomfy

1.0.7 • Public • Published

ESLint config for MadeComfy

About

In the interest of DRY and Code formatting we want to define one format across all our applications

Installation

Assumes you have a working node project (ie, package.json exists) with code in ./src/

install module:

yarn add eslint-config-madecomfy --dev

create eslintrc:

touch .eslintrc

populate .eslintrc with:

{
    "extends": [
      "madecomfy"
    ]
}

add lint execution script to package.json:

  ...
  "scripts": {
    "build": "webpack",
    "lint": "eslint src"
  },
  ...

Linting

yarn lint

Lint staged files before committing

The following steps will prevent badly formatted code from being pushed to remote.

install modules:

yarn add husky lint-staged --dev

add precommit hook to package.json:

  ...
  "scripts": {
    "build": "webpack",
    "lint": "eslint src",
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "src/**/*.{js,jsx}": [
      "eslint --fix",
      "git add"
    ]
  }
  ...

/eslint-config-madecomfy/

    Package Sidebar

    Install

    npm i eslint-config-madecomfy

    Weekly Downloads

    179

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    10.3 kB

    Total Files

    4

    Last publish

    Collaborators

    • hiennguyenmadecomfy
    • quattruong
    • andrii_pere
    • toriadamo
    • duc.dao
    • smaharjanmc
    • chungrya
    • madecomfy.eng
    • janaengelhardt
    • janani0212