feat: add rules for react code (!4)

Reviewed-on: https://codeberg.org/nhcarrigan/eslint-config/pulls/4
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
2024-09-26 02:39:45 +00:00
committed by Naomi the Technomancer
parent 96935e12b4
commit 2a97017582
5 changed files with 892 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import { stylisticRules } from "../src/rules/stylistic.ts";
import { typescriptEslintRules } from "../src/rules/typescriptEslint.js";
import { unicornRules } from "../src/rules/unicorn.js";
import { vitestRules } from "../src/rules/vitest.js";
import { reactRules } from "../prod/rules/react.js";
describe("no rules should be turned off in", () => {
it("eslint rules", () => {
@ -55,6 +56,16 @@ describe("no rules should be turned off in", () => {
}
});
it("react rules", () => {
expect.assertions(70);
const rules = Object.entries(reactRules);
for (const [ name, rule ] of rules) {
expect(Array.isArray(rule)
? rule.at(0)
: rule, `${name} appears to be turned off - this project does not use any external configs, so all rules should be off by default.`).not.toBe("off");
}
});
it("stylistic rules", () => {
expect.assertions(65);
const rules = Object.entries(stylisticRules);