diff --git a/README.md b/README.md index 2145086..d001379 100644 --- a/README.md +++ b/README.md @@ -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 { diff --git a/lib/index.js b/lib/index.js index 3c4aa22..d7587e6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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") +}