Enable app-wide StrictMode and restore React effect checks
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s
This commit is contained in:
parent
b0e340efc7
commit
a9b68a5712
5 changed files with 21 additions and 3 deletions
12
tests/react-lint.test.mjs
Normal file
12
tests/react-lint.test.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// 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`);
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue