65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
// Rôle : configure ESLint pour le code React, les hooks et les scripts Node du projet.
|
|
import js from "@eslint/js";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import globals from "globals";
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
"node_modules/**",
|
|
"website/dist/**",
|
|
".codex-home/**"
|
|
]
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ["website/src/**/*.{js,jsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.es2024
|
|
},
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true
|
|
}
|
|
}
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-hooks/purity": "off",
|
|
"react-hooks/set-state-in-effect": "off",
|
|
"no-unused-vars": ["error", {
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_"
|
|
}],
|
|
"react-refresh/only-export-components": "off"
|
|
}
|
|
},
|
|
{
|
|
files: ["*.js", "*.mjs", "scripts/**/*.mjs", "tests/**/*.mjs"],
|
|
languageOptions: {
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
globals: {
|
|
...globals.node,
|
|
...globals.es2024
|
|
}
|
|
},
|
|
rules: {
|
|
"no-unused-vars": ["error", {
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_"
|
|
}]
|
|
}
|
|
}
|
|
];
|