Skip to content

Commit

Permalink
Add recommended config and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmehta committed Feb 18, 2018
1 parent a38af5b commit 999175b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ $ npm install eslint-plugin-flow-header --save-dev

## Usage

Add `flow-header` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
### Recommended configuration

Add `flow-header` to your `.eslintrc` configuration file by extending the `recommended` configuration. The recommended config just adds the `flow-header` rule to your configuration.

```json
{
"extends": [
"plugin:flow-header/recommended"
]
}
```

### Add Eslint Rule

You can also add the rule manually by using flow-header as a plugin. Add `flow-header` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
Expand Down
15 changes: 11 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ var requireIndex = require("requireindex");


// import all rules in lib/rules
module.exports.rules = requireIndex(__dirname + "/rules");



module.exports = {
configs: {
recommended: {
plugins: ["flow-header"],
rules: {
"flow-header/flow-header": 2
}
}
},
rules: requireIndex(__dirname + "/rules")
}

0 comments on commit 999175b

Please sign in to comment.