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' }], }, }, ];