Skip to content

Commit eb35605

Browse files
author
Yannick Croissant
committed
Add test for recommended configuration and rules metadata consistency
1 parent 80e481e commit eb35605

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ describe('configurations', function() {
3131
var ruleName = configName.substring('react/'.length);
3232
assert(plugin.rules[ruleName]);
3333
});
34+
35+
ruleFiles.forEach(function(ruleName) {
36+
var inRecommendedConfig = Boolean(plugin.configs.recommended.rules['react/' + ruleName]);
37+
var isRecommended = plugin.rules[ruleName].meta.docs.recommended;
38+
if (inRecommendedConfig) {
39+
assert(isRecommended, ruleName + ' metadata should mark it as recommended');
40+
} else {
41+
assert(!isRecommended, ruleName + ' metadata should not mark it as recommended');
42+
}
43+
});
3444
});
3545
it('should export a \'all\' configuration', function() {
3646
assert(plugin.configs.all);

0 commit comments

Comments
 (0)