-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from dabapps/readme
Add some useful info to readme
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
# DabApps ESLint Configuration | ||
|
||
## Install | ||
|
||
If there's a suitable version of eslint-config, include the eslint-config in your package.json. | ||
Recommended to pin a specific version. | ||
|
||
```json | ||
"devDependencies": { | ||
"eslint-config": "git://github.com/dabapps/eslint-config.git#1.0.0", | ||
} | ||
``` | ||
|
||
If you need additional plugins or some slightly different config, you can just copy the rules & create your own eslintrc file (but this shouldn't be nessecary). | ||
|
||
You'll also need to include eslint & any other plugins that are needed in your package.json. | ||
You can find out suitable versions from eslint-config's package.json. | ||
|
||
```json | ||
"devDependencies": { | ||
"eslint": "=1.5.1", | ||
"eslint-plugin-react": "=3.5.0" | ||
} | ||
``` | ||
|
||
## Running eslint | ||
|
||
Add a script like the following to your package.json (-c defines the config location). | ||
|
||
```json | ||
"scripts": { | ||
"eslint": "eslint -c node_modules/eslint-config/.eslintrc 'src/js/'", | ||
} | ||
``` | ||
|
||
It's recommeneded to then run this in your test script e.g. | ||
|
||
```json | ||
"scripts": { | ||
"test": "npm run eslint && npm run jest", | ||
} | ||
``` |