4.0.4 • Published 7 years ago

eslint-config-ory-am-react v4.0.4

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
7 years ago

ory.am/eslint-config-ory-am-react

Installation

Install ESLint and the our configuration. You will probably also want to use eslint-config-ory-am

npm install --save-dev eslint eslint-config-ory-am eslint-config-ory-am-react

Create a .eslintrc.json file in your root with the following content:

{
  "extends": [
    "eslint-config-ory-am",
    "eslint-config-ory-am-react"
  ],
  "env": {
    "node": true,
    "browser": true
  }
}

Add a linter script to your package.json. In the following example, all files in the src and test folder (and their subfolders) are checked:

{
  "scripts": {
    "lint": "eslint \"+(src|test)/**/*.js\" --fix"
  }
}

Watcher task

You can use chokidar-cli to add a task that lints your files on save. First install it:

npm install --save-dev chokidar-cli

Then add a watch script to your package.json. In the following example, chokidar will look for changes in any files in the src and test folder (and their subfolders):

{
  "scripts": {
    "lint": "eslint \"+(src|test)/**/*.js\" --fix",
    "lint:watch": "npm run watch:js -- -c \"npm run lint\"",
    "watch:js": "chokidar \"+(src|test)/**/*.js\" --initial"
  }
}
4.0.4

7 years ago

4.0.3

7 years ago

4.0.0

7 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago