Skip to content

Commit

Permalink
feat: Include plugin in configs (#56)
Browse files Browse the repository at this point in the history
* feat: specify plugin in recommended config

* test: assert recommended config includes plugin
  • Loading branch information
jordanbtucker authored Sep 4, 2020
1 parent 2d0d49b commit df981f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
rules,
configs: {
recommended: {
plugins: ['react-redux'],
rules: {
'react-redux/connect-prefer-minimum-two-arguments': 0,
'react-redux/connect-prefer-named-arguments': 2,
Expand All @@ -43,6 +44,7 @@ module.exports = {
},
},
all: {
plugins: ['react-redux'],
rules: activeRulesConfig,
},
},
Expand Down
2 changes: 2 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('all rule files should be exported by the plugin', () => {
describe('configurations', () => {
it('should export a \'recommended\' configuration', () => {
assert(plugin.configs.recommended);
assert(plugin.configs.recommended.plugins.includes('react-redux'));
Object.keys(plugin.configs.recommended.rules).forEach((configName) => {
assert.equal(configName.indexOf('react-redux/'), 0);
const ruleName = configName.substring('react-redux/'.length);
Expand All @@ -30,6 +31,7 @@ describe('configurations', () => {
});
it('should export a \'all\' configuration', () => {
assert(plugin.configs.all);
assert(plugin.configs.all.plugins.includes('react-redux'));
Object.keys(plugin.configs.all.rules).forEach((configName) => {
assert.equal(configName.indexOf('react-redux/'), 0);
assert.equal(plugin.configs.all.rules[configName], 2);
Expand Down

0 comments on commit df981f9

Please sign in to comment.