From 111b2f6f53c6ff854d954986bdb1a10cdec21e78 Mon Sep 17 00:00:00 2001 From: gcch Date: Sun, 5 Apr 2026 13:10:55 +0200 Subject: [PATCH] 2026-04-06 --- rules/import.ts | 9 ++++++++- rules/unicorn.ts | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/rules/import.ts b/rules/import.ts index b35d6df..be95963 100644 --- a/rules/import.ts +++ b/rules/import.ts @@ -82,7 +82,14 @@ const importRules: DummyRuleMap = { "import/no-named-as-default": "deny", "import/no-named-as-default-member": "deny", "import/no-named-default": "deny", - "import/no-named-export": "deny", + /** + * Prohibit named exports. + * + * Named exports require strict identifier matching and can lead to fragile imports, while default exports enforce a single, consistent module entry point. + * + * Activer cette règle empêche l'existence de multiples exports au sein d'un module. + */ + "import/no-named-export": "allow", "import/no-namespace": "deny", "import/no-nodejs-modules": "allow", "import/no-relative-parent-imports": "allow", diff --git a/rules/unicorn.ts b/rules/unicorn.ts index 130d645..445aa25 100644 --- a/rules/unicorn.ts +++ b/rules/unicorn.ts @@ -21,40 +21,61 @@ const unicornRules: DummyRuleMap = { "unicorn/no-array-method-this-argument": "deny", "unicorn/no-array-reverse": "deny", "unicorn/no-array-sort": "deny", + /** Disallow using await in Promise method parameters. */ "unicorn/no-await-in-promise-methods": "deny", "unicorn/no-console-spaces": "deny", "unicorn/no-document-cookie": "deny", + /** Disallows files that do not contain any meaningful code. */ "unicorn/no-empty-file": "deny", "unicorn/no-hex-escape": "deny", "unicorn/no-instanceof-builtins": "deny", + /** + * Disallow invalid options in `fetch()` and new `Request().` Specifically, this rule ensures that a body is not + * provided when the method is `GET` or `HEAD,` as it will result in a `TypeError.` + */ "unicorn/no-invalid-fetch-options": "deny", + /** It warns when you use a non-function value as the second argument of `removeEventListener`. */ "unicorn/no-invalid-remove-event-listener": "deny", "unicorn/no-lonely-if": "deny", "unicorn/no-magic-array-flat-depth": "deny", "unicorn/no-negated-condition": "deny", "unicorn/no-negation-in-equality-check": "deny", "unicorn/no-nested-ternary": "deny", + /** Disallow new `Array()`. */ "unicorn/no-new-array": "deny", "unicorn/no-new-buffer": "deny", "unicorn/no-null": "deny", "unicorn/no-object-as-default-parameter": "deny", "unicorn/no-process-exit": "deny", + /** Disallow passing single-element arrays to `Promise` methods. */ "unicorn/no-single-promise-in-promise-methods": "deny", "unicorn/no-static-only-class": "deny", + /** Disallow defining a `then` property. */ "unicorn/no-thenable": "deny", "unicorn/no-this-assignment": "deny", "unicorn/no-typeof-undefined": "deny", "unicorn/no-unnecessary-array-flat-depth": "deny", "unicorn/no-unnecessary-array-splice-count": "deny", + /** Disallow awaiting on non-`Promise` values. */ "unicorn/no-unnecessary-await": "deny", "unicorn/no-unnecessary-slice-end": "deny", "unicorn/no-unreadable-array-destructuring": "deny", "unicorn/no-unreadable-iife": "deny", "unicorn/no-useless-collection-argument": "deny", "unicorn/no-useless-error-capture-stack-trace": "deny", + /** Disallow useless fallback when spreading in object litterals. */ "unicorn/no-useless-fallback-in-spread": "deny", + /** It checks for an unnecessary array length check in a logical expression. */ "unicorn/no-useless-length-check": "deny", "unicorn/no-useless-promise-resolve-reject": "deny", + /** + * Disallows using spread syntax in following, unnecessary cases: + * + * - Spread an array literal as elements of an array literal + * - Spread an array literal as arguments of a call or a new call + * - Spread an object literal as properties of an object literal + * - Use spread syntax to clone an array created inline + */ "unicorn/no-useless-spread": "deny", "unicorn/no-useless-switch-case": "deny", "unicorn/no-useless-undefined": "deny", @@ -99,10 +120,12 @@ const unicornRules: DummyRuleMap = { "unicorn/prefer-regexp-test": "deny", "unicorn/prefer-response-static-json": "deny", "unicorn/prefer-set-has": "deny", + /** Prefer `Set#size` over `Set#length` when the `Set` is converted to an array. */ "unicorn/prefer-set-size": "deny", "unicorn/prefer-string-raw": "deny", "unicorn/prefer-string-replace-all": "deny", "unicorn/prefer-string-slice": "deny", + /** Prefer `String#startsWith()` and `String#endsWith()` over using a regex with `/^foo/` or `/foo$/`. */ "unicorn/prefer-string-starts-ends-with": "deny", "unicorn/prefer-string-trim-start-end": "deny", "unicorn/prefer-structured-clone": "deny",