Skip to content

cratebind/eslint-config-cratebind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-cratebind

Cratebind ES Lint Config

Installation

  1. Install ESLint:
$ npm i eslint --save-dev
# OR
$ yarn add eslint
  1. Install eslint-config-cratebind:
$ npm install eslint-config-cratebind --save-dev
# OR
$ yarn add eslint-config-cratebind

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-config-cratebind globally.

Usage

Create or update the .eslintrc file in the root of your directory and extend cratebind. You can omit the eslint-config- prefix:

{
    "extends": ["cratebind"]
}

Then overwrite rules as needed:

{
    "extends": ["cratebind"],
    "rules": {
        // 0 is ignore, 1 is warning, 2 is error
        "react/prop-types": 0
    }
}

NPM Script

It's recommended to add a lint script to your NPM scripts:

{
    "scripts": {
        // --cache flag improves performance, --fix will autofix fixable issues
        "lint": "eslint --cache \"**/*.js\" --fix"
    }
}

Git Hooks

It's also highly recommended to use Husky and Lint Staged to lint your code before committing:

  1. Install Husky and Lint Staged
yarn add -D husky lint-staged
  1. Add these to your package.json
{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.+(js|ts|tsx)": [
      "eslint --cache --fix --quiet",
      "git add"
    ]
  }
}

This combination is

About

Custom ES Lint Config for Cratebind

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published