sokko-g/tests/react-lint.test.mjs
Shinuwa a9b68a5712
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s
Enable app-wide StrictMode and restore React effect checks
2026-09-12 12:53:08 +02:00

12 lines
641 B
JavaScript

// Rôle : vérifie que les contrôles React critiques restent actifs dans la configuration ESLint effective.
import { test } from "node:test";
import assert from "node:assert/strict";
import { ESLint } from "eslint";
test("React effect and purity checks are enabled for application sources", async () => {
const eslint = new ESLint();
const config = await eslint.calculateConfigForFile("website/src/main.jsx");
for (const rule of ["react-hooks/set-state-in-effect", "react-hooks/purity", "react-hooks/rules-of-hooks", "react-hooks/exhaustive-deps"]) {
assert.ok(config.rules[rule][0] > 0, `${rule} must remain enabled`);
}
});