Skip to content

Commit 05a2ce9

Browse files
authored
test: add tests for recommended rules (#134)
1 parent d6721f0 commit 05a2ce9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/plugin/eslint.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ describe("when the plugin is used with ESLint", () => {
3636
await eslint.lintText("{}", { filePath: "test.json" });
3737
});
3838
});
39+
40+
it("recommended config should configure recommended rules", () => {
41+
const actualRuleIds = Object.keys(json.configs.recommended.rules);
42+
const expectedRuleIds = Object.entries(json.rules)
43+
.filter(([, rule]) => rule.meta.docs.recommended)
44+
.map(([name]) => `json/${name}`);
45+
assert.deepStrictEqual(actualRuleIds, expectedRuleIds);
46+
});
3947
});
4048

4149
describe("config comments", () => {

0 commit comments

Comments
 (0)