From bfa2f9344eabebc43f3b62cf9d3d75048d78f5fe Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Sun, 3 Oct 2021 16:28:51 -0400 Subject: [PATCH] Breaking: Add `fixer-return` to `rules` preset All rules should have a category of either `Rules` or `Tests` since this is how those presets are generated. --- lib/rules/fixer-return.js | 2 +- tests/lib/rule-setup.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/rules/fixer-return.js b/lib/rules/fixer-return.js index 40dfa5df..787dfecb 100644 --- a/lib/rules/fixer-return.js +++ b/lib/rules/fixer-return.js @@ -21,7 +21,7 @@ module.exports = { type: 'problem', docs: { description: 'require fixer functions to return a fix', - category: 'Possible Errors', + category: 'Rules', recommended: true, }, fixable: null, diff --git a/tests/lib/rule-setup.js b/tests/lib/rule-setup.js index 856f4a57..c52c7831 100644 --- a/tests/lib/rule-setup.js +++ b/tests/lib/rule-setup.js @@ -37,6 +37,18 @@ describe('rule setup is correct', () => { ); }); + describe('rule files', () => { + for (const ruleName of RULE_NAMES) { + const rule = plugin.rules[ruleName]; + describe(ruleName, () => { + it('has the right properties', () => { + const ALLOWED_CATEGORIES = ['Rules', 'Tests']; + assert.ok(ALLOWED_CATEGORIES.includes(rule.meta.docs.category), 'has an allowed category'); + }); + }); + } + }); + it('should have tests for all rules', () => { const filePath = path.join(__dirname, 'rules'); const files = readdirSync(filePath);