This commit is contained in:
2026-03-22 02:14:19 +01:00
parent eb27ea441b
commit 435d1d299f
7 changed files with 4995 additions and 12 deletions

11
.lintstagedrc Normal file
View File

@@ -0,0 +1,11 @@
{
"*.js": ["eslint --fix", "prettier --write"],
"*.css": ["prettier --write"],
"*.jsx": ["prettier --write"],
"*.html.twig": ["twig-cs-fixer lint --fix", "myhtmlvalidate -q"],
"*.php": ["php-cs-fixer fix --config .php-cs-fixer.php"],
"Dockerfile": ["hadolint --ignore DL3002 --ignore DL3003 --ignore DL3008 --ignore DL3013 --ignore DL3016 --ignore DL3022"],
"*.md": ["markdownlint --fix"],
"*openapi.json": ["spectral lint"],
"*.tf": ["tflint"]
}

6
.prettierignore Normal file
View File

@@ -0,0 +1,6 @@
web/*
views/*
log/*
node_modules/*
coverage/*
data/*

7
.prettierrc.js Normal file
View File

@@ -0,0 +1,7 @@
export default {
tabWidth: 4,
singleQuote: true,
trailingComma: 'es5',
printWidth: 150,
arrowParens: 'always',
};

15
.twig-cs-fixer.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
$ruleset = new TwigCsFixer\Ruleset\Ruleset();
// You can start from a default standard
$ruleset->addStandard(new TwigCsFixer\Standard\TwigCsFixer());
// And then add/remove/override some rules
$ruleset->removeRule(TwigCsFixer\Rules\Function\IncludeFunctionRule::class);
$ruleset->removeRule(TwigCsFixer\Rules\Punctuation\TrailingCommaMultiLineRule::class);
$config = new TwigCsFixer\Config\Config();
$config->setRuleset($ruleset);
return $config;

275
eslint.config.js Normal file
View File

@@ -0,0 +1,275 @@
import sonarjs from 'eslint-plugin-sonarjs';
import unicorn from 'eslint-plugin-unicorn';
import promise from 'eslint-plugin-promise';
import n from 'eslint-plugin-n';
import raflint from 'eslint-plugin-raflint';
import pluginimport from 'eslint-plugin-import';
import babelParser from '@babel/eslint-parser';
import js from '@eslint/js';
import globals from 'globals';
export default [
// eslint:recommended,
js.configs.recommended,
// unicorn
unicorn.configs['flat/recommended'],
// n
n.configs['flat/recommended'],
// sonarjs
sonarjs.configs.recommended,
// promise
promise.configs['flat/recommended'],
// plugin:import/recommended,
pluginimport.flatConfigs.recommended,
{
ignores: ['node_modules/', 'web/', 'public/', 'coverage/', 'data/', 'vendor/', 'cypress/', 'react/', 'js/', 'assets/', '**/old/'],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.mocha,
},
parser: babelParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
},
},
plugins: {
raflint,
},
rules: {
'sonarjs/no-empty-function': 0,
'sonarjs/no-unused-expressions': 0,
'sonarjs/no-unsafe-unzip': 0,
'sonarjs/os-command': 0,
'sonarjs/cors': 0,
'sonarjs/publicly-writable-directories': 0,
'sonarjs/file-permissions': 0,
'sonarjs/no-empty-test-file': 0,
'import/no-named-as-default-member': 0,
'import/no-unresolved': [
'error',
{
ignore: ['^yargs/helpers$'],
},
],
'sonarjs/regex-complexity': 0,
'sonarjs/no-clear-text-protocols': 0,
'sonarjs/no-infinite-loop': 0,
'sonarjs/no-hardcoded-ip': 0,
'sonarjs/pluginRules-of-hooks': 0,
'sonarjs/sonar-no-fallthrough': 0,
'sonarjs/no-ignored-exceptions': 0,
'sonarjs/slow-regex': 0,
'sonarjs/concise-regex': 0,
'sonarjs/hashing': 0,
'sonarjs/no-dead-store': 0,
'sonarjs/no-unused-vars': 0,
'sonarjs/no-hardcoded-passwords': 0,
'sonarjs/no-hardcoded-secrets': 0,
'sonarjs/unnecessary-character-escapes': 0,
'sonarjs/pseudo-random': 0,
'sonarjs/no-os-command-from-path': 0,
'sonarjs/anchor-precedence': 0,
'sonarjs/no-nested-functions': 0,
'sonarjs/new-cap': 0,
'sonarjs/sql-queries': 0,
'sonarjs/content-length': 0,
'sonarjs/no-commented-code': 0,
'raflint/no-conditional-object-spread': ['error'],
'raflint/no-path-join': ['error'],
'unicorn/prefer-event-target': 0,
'unicorn/prefer-structured-clone': 0,
'unicorn/prefer-string-raw': 0,
'unicorn/no-anonymous-default-export': 0,
'unicorn/better-regex': 0,
'unicorn/catch-error-name': 0,
'unicorn/consistent-function-scoping': 0,
'unicorn/expiring-todo-comments': 0,
'unicorn/explicit-length-check': 0,
'unicorn/import-style': 0,
'unicorn/no-array-for-each': 0,
'unicorn/prefer-single-call': 0,
'unicorn/no-array-reduce': 0,
'unicorn/no-lonely-if': 0,
'unicorn/no-negated-condition': 0,
'unicorn/no-null': 0,
'unicorn/no-process-exit': 0,
'unicorn/no-this-assignment': 0,
'unicorn/no-unnecessary-await': 0,
'unicorn/no-unused-properties': 0,
'unicorn/prefer-code-point': 0,
'unicorn/prefer-default-parameters': 0,
'unicorn/prefer-export-from': 0,
'unicorn/prefer-native-coercion-functions': 0,
'unicorn/prefer-number-properties': 0,
'unicorn/prefer-set-has': 0,
'unicorn/prefer-set-size': 0,
'unicorn/prefer-spread': 0,
'unicorn/prefer-string-replace-all': 0,
'unicorn/prefer-string-slice': 0,
'unicorn/prefer-switch': 0,
'unicorn/prefer-ternary': 0,
'unicorn/prefer-top-level-await': 0,
'unicorn/prevent-abbreviations': 0,
'unicorn/relative-url-style': 0,
'unicorn/switch-case-braces': 0,
'unicorn/template-indent': 0,
'unicorn/text-encoding-identifier-case': 0,
'unicorn/prefer-regexp-test': 0,
'unicorn/prefer-optional-catch-binding': 0,
'unicorn/filename-case': [
'error',
{
case: 'camelCase',
},
],
'sonarjs/cognitive-complexity': 0,
'sonarjs/no-nested-template-literals': 0,
'sonarjs/no-collapsible-if': 0,
'sonarjs/no-duplicate-string': 0,
'sonarjs/prefer-immediate-return': 0,
'sonarjs/no-identical-functions': 0,
'sonarjs/prefer-object-literal': 0,
'sonarjs/prefer-single-boolean-return': 0,
'n/no-unpublished-import': 0,
'n/no-unsupported-features/es-syntax': 0,
'n/no-missing-import': 0,
'n/no-process-exit': 0,
// si on l'active ça pose pb dans check / automerge
'n/shebang': 0,
'one-var-declaration-per-line': ['error', 'always'],
'one-var': ['error', 'never'],
'no-unused-expressions': 'error',
'no-nested-ternary': 'error',
'no-use-before-define': [
'error',
{
functions: false,
classes: false,
variables: true,
allowNamedExports: false,
},
],
'no-new-native-nonconstructor': 'error',
'no-empty-static-block': 'error',
'symbol-description': 'error',
'require-yield': 'error',
'prefer-spread': 'error',
'prefer-rest-params': 'error',
'prefer-object-spread': 'error',
'prefer-object-has-own': 'error',
'prefer-numeric-literals': 'error',
'prefer-exponentiation-operator': 'error',
'operator-assignment': 'error',
'no-useless-rename': 'error',
'no-useless-constructor': 'error',
'no-useless-computed-key': 'error',
'no-unused-labels': 'error',
'no-script-url': 'error',
'no-new-object': 'error',
'no-multi-assign': 'error',
'no-loop-func': 'error',
'no-inline-comments': 'error',
'no-implicit-coercion': 'error',
'no-extra-boolean-cast': 'error',
'no-confusing-arrow': 'error',
'no-case-declarations': 'error',
'no-bitwise': 'error',
'no-array-constructor': 'error',
'no-alert': 'error',
'logical-assignment-operators': 'error',
'grouped-accessor-pairs': 'error',
'func-name-matching': 'error',
'dot-notation': 'error',
'consistent-this': ['error', 'self'],
'accessor-pairs': 'error',
'no-unused-private-class-members': 'error',
'no-promise-executor-return': 'error',
'no-duplicate-imports': 'error',
'no-constant-binary-expression': 'error',
'no-undef-init': 'error',
'no-label-var': 'error',
'init-declarations': ['error', 'always'],
'wrap-iife': ['error', 'inside'],
yoda: 'error',
'vars-on-top': 'error',
radix: ['error', 'as-needed'],
'prefer-regex-literals': 'error',
'prefer-promise-reject-errors': 'error',
'no-warning-comments': 'error',
'no-void': 'error',
'no-useless-return': 'error',
'no-useless-concat': 'error',
'no-useless-call': 'error',
'no-throw-literal': 'error',
'no-sequences': 'error',
'no-self-compare': 'error',
'no-return-assign': 'error',
'no-proto': 'error',
'no-octal-escape': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-new-wrappers': 'error',
'no-new-func': 'error',
'no-new': 'error',
'no-multi-str': 'error',
'no-multi-spaces': 'error',
'no-lone-blocks': 'error',
'no-labels': 'error',
'no-iterator': 'error',
'no-empty-function': 'error',
'block-scoped-var': 'error',
'prefer-arrow-callback': 'error',
'no-implied-eval': 'error',
'no-implicit-globals': 'error',
'no-floating-decimal': 'error',
'no-extra-label': 'error',
'no-extra-bind': 'error',
'no-extend-native': [
'error',
{
exceptions: ['Object'],
},
],
'no-eval': 'error',
'no-constant-condition': ['error', { checkLoops: false }],
'no-eq-null': 'error',
'no-else-return': 'error',
'no-unused-vars': 0,
'no-console': 0,
'no-empty': 0,
'no-redeclare': 0,
'no-useless-escape': 0,
'no-var': 'error',
'object-shorthand': ['error', 'properties'],
'prefer-template': 'error',
'no-div-regex': 'error',
'no-constructor-return': 'error',
'no-caller': 'error',
'max-classes-per-file': 'error',
'default-param-last': 'error',
'default-case-last': 'error',
'default-case': 'error',
'array-callback-return': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unreachable-loop': 'error',
'no-template-curly-in-string': 'error',
'no-loss-of-precision': 'error',
'no-inner-declarations': 0,
'no-process-exit': 0,
'prefer-const': ['error', { destructuring: 'all' }],
},
},
];

4681
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -26,8 +26,20 @@
"mysql2": "^3.20.0" "mysql2": "^3.20.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.29.0",
"@babel/eslint-parser": "^7.28.6",
"@eslint/js": "^10.0.1",
"eslint": "^10.1.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-n": "^17.24.0",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-raflint": "^1.3.4",
"eslint-plugin-sonarjs": "^4.0.2",
"eslint-plugin-unicorn": "^63.0.0",
"globals": "^17.4.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"lint-staged": "^16.4.0", "lint-staged": "^16.4.0",
"prettier": "^3.8.1",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
}, },
"engines": { "engines": {