sokko-g/tests/react-lint.test.mjs
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md
(setup and step-by-step recipes) and a README in each main folder, with an
index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to
JSDoc @file blocks, define a three-level header template in website/AGENTS.md
and check the header in tests/file-headers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:42:13 +01:00

23 lines
1,008 B
JavaScript

/**
* @file Vérifie les règles React actives et l'exclusion des artefacts générés du lint.
*/
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`);
}
});
test("browser reports are ignored without excluding authored E2E tests", async () => {
const eslint = new ESLint();
for (const path of ["playwright-report/trace/assets/viewer.js", "test-results/production/trace.js"]) {
assert.equal(await eslint.isPathIgnored(path), true, path);
}
assert.equal(await eslint.isPathIgnored("e2e/nds-controls.spec.js"), false);
});