Skip to content

Commit 7cac82a

Browse files
authored
Breaking: Add fixer-return to rules preset (#199)
All rules should have a category of either `Rules` or `Tests` since this is how those presets are generated.
1 parent a7b480e commit 7cac82a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/rules/fixer-return.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
type: 'problem',
2222
docs: {
2323
description: 'require fixer functions to return a fix',
24-
category: 'Possible Errors',
24+
category: 'Rules',
2525
recommended: true,
2626
},
2727
fixable: null,

tests/lib/rule-setup.js

+12
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ describe('rule setup is correct', () => {
3737
);
3838
});
3939

40+
describe('rule files', () => {
41+
for (const ruleName of RULE_NAMES) {
42+
const rule = plugin.rules[ruleName];
43+
describe(ruleName, () => {
44+
it('has the right properties', () => {
45+
const ALLOWED_CATEGORIES = ['Rules', 'Tests'];
46+
assert.ok(ALLOWED_CATEGORIES.includes(rule.meta.docs.category), 'has an allowed category');
47+
});
48+
});
49+
}
50+
});
51+
4052
it('should have tests for all rules', () => {
4153
const filePath = path.join(__dirname, 'rules');
4254
const files = readdirSync(filePath);

0 commit comments

Comments
 (0)