Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@ $ 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"
],
"plugins": [
"flow-header"
]
}
```

### 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")
}