configuration-oxlint/dist/index.mjs
gcch 32ed83d772 0.0.4
- corvée: met à jour les dépendances
- corvée: utilise treefmt pour le formatage
- corvée: nettoie les règles
2026-04-11 15:11:50 +02:00

1142 lines
No EOL
35 KiB
JavaScript

import { defineConfig } from "oxlint";
//#region ../rules/astro.ts
const astroConfig = {
env: { astro: true },
files: ["**/*.astro"],
jsPlugins: ["eslint-plugin-astro"],
rules: {
"astro/jsx-a11y/alt-text": "deny",
"astro/jsx-a11y/anchor-ambiguous-text": "deny",
"astro/jsx-a11y/anchor-has-content": "deny",
"astro/jsx-a11y/anchor-is-valid": "deny",
"astro/jsx-a11y/aria-activedescendant-has-tabindex": "deny",
"astro/jsx-a11y/aria-props": "deny",
"astro/jsx-a11y/aria-proptypes": "deny",
"astro/jsx-a11y/aria-role": "deny",
"astro/jsx-a11y/aria-unsupported-elements": "deny",
"astro/jsx-a11y/autocomplete-valid": "deny",
"astro/jsx-a11y/click-events-have-key-events": "deny",
"astro/jsx-a11y/control-has-associated-label": "deny",
"astro/jsx-a11y/heading-has-content": "deny",
"astro/jsx-a11y/html-has-lang": "deny",
"astro/jsx-a11y/iframe-has-title": "deny",
"astro/jsx-a11y/img-redundant-alt": "deny",
"astro/jsx-a11y/interactive-supports-focus": "deny",
"astro/jsx-a11y/label-has-associated-control": "deny",
"astro/jsx-a11y/lang": "deny",
"astro/jsx-a11y/media-has-caption": "deny",
"astro/jsx-a11y/mouse-events-have-key-events": "deny",
"astro/jsx-a11y/no-access-key": "deny",
"astro/jsx-a11y/no-aria-hidden-on-focusable": "deny",
"astro/jsx-a11y/no-autofocus": "deny",
"astro/jsx-a11y/no-distracting-elements": "deny",
"astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "deny",
"astro/jsx-a11y/no-noninteractive-element-interactions": "deny",
"astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "deny",
"astro/jsx-a11y/no-noninteractive-tabindex": "deny",
"astro/jsx-a11y/no-redundant-roles": "deny",
"astro/jsx-a11y/no-static-element-interactions": "deny",
"astro/jsx-a11y/prefer-tag-over-role": "deny",
"astro/jsx-a11y/role-has-required-aria-props": "deny",
"astro/jsx-a11y/role-supports-aria-props": "deny",
"astro/jsx-a11y/scope": "deny",
"astro/jsx-a11y/tabindex-no-positive": "deny",
"astro/missing-client-only-directive-value": "deny",
"astro/no-conflict-set-directives": "deny",
"astro/no-deprecated-astro-canonicalurl": "deny",
"astro/no-deprecated-astro-fetchcontent": "deny",
"astro/no-deprecated-astro-resolve": "deny",
"astro/no-deprecated-getentrybyslug": "deny",
"astro/no-exports-from-components": "deny",
"astro/no-set-html-directive": "deny",
"astro/no-set-text-directive": "deny",
"astro/no-unused-css-selector": "deny",
"astro/no-unused-define-vars-in-style": "deny",
"astro/prefer-class-list-directive": "deny",
"astro/prefer-object-class-list": "deny",
"astro/prefer-split-class-list": ["deny", { splitLiteral: false }],
"astro/sort-attributes": ["deny", {
ignoreCase: false,
order: "asc",
type: "alphabetical"
}],
"astro/valid-compile": "deny"
}
};
//#endregion
//#region ../rules/eslint.ts
const esLintRules = {
"eslint/accessor-pairs": ["deny", { enforceForTSTypes: true }],
"eslint/array-callback-return": ["deny", { checkForEach: true }],
"eslint/arrow-body-style": [
"deny",
"as-needed",
{ requireReturnForObjectLiteral: false }
],
"eslint/block-scoped-var": "deny",
"eslint/capitalized-comments": [
"deny",
"always",
{
block: { ignoreConsecutiveComments: true },
line: { ignoreConsecutiveComments: true }
}
],
"eslint/constructor-super": "deny",
"eslint/curly": ["deny", "all"],
"eslint/default-case": "deny",
"eslint/default-case-last": "deny",
"eslint/default-param-last": "deny",
"eslint/eqeqeq": "deny",
"eslint/for-direction": "deny",
"eslint/func-names": "allow",
"eslint/func-style": [
"deny",
"expression",
{ allowArrowFunctions: true }
],
"eslint/getter-return": "deny",
"eslint/grouped-accessor-pairs": [
"deny",
"setBeforeGet",
{ enforceForTSTypes: true }
],
"eslint/guard-for-in": "deny",
"eslint/id-length": ["deny", {
checkGeneric: true,
exceptionPatterns: [],
exceptions: ["_"],
max: 1e8,
min: 2,
properties: "always"
}],
"eslint/init-declarations": ["deny", "always"],
"eslint/new-cap": ["deny", {
capIsNew: false,
newIsCap: true,
properties: true
}],
"eslint/no-alert": "deny",
"eslint/no-array-constructor": "deny",
"eslint/no-async-promise-executor": "deny",
"eslint/no-await-in-loop": "deny",
"eslint/no-bitwise": "deny",
"eslint/no-caller": "deny",
"eslint/no-case-declarations": "deny",
"eslint/no-class-assign": "deny",
"eslint/no-compare-neg-zero": "deny",
"eslint/no-cond-assign": "deny",
"eslint/no-console": "allow",
"eslint/no-const-assign": "deny",
"eslint/no-constant-binary-expression": "deny",
"eslint/no-constant-condition": ["deny", { checkLoops: "allExceptWhileTrue" }],
"eslint/no-constructor-return": "deny",
"eslint/no-continue": "allow",
"eslint/no-control-regex": "deny",
"eslint/no-debugger": "deny",
"eslint/no-delete-var": "deny",
"eslint/no-div-regex": "allow",
"eslint/no-dupe-class-members": "deny",
"eslint/no-dupe-else-if": "deny",
"eslint/no-dupe-keys": "deny",
"eslint/no-duplicate-case": "deny",
"eslint/no-duplicate-imports": ["deny", {
allowSeparateTypeImports: true,
includeExports: false
}],
"eslint/no-else-return": "allow",
"eslint/no-empty": ["deny", { allowEmptyCatch: false }],
"eslint/no-empty-character-class": "deny",
"eslint/no-empty-function": ["deny", { allow: [] }],
"eslint/no-empty-pattern": "deny",
"eslint/no-empty-static-block": "deny",
"eslint/no-eq-null": "deny",
"eslint/no-eval": "deny",
"eslint/no-ex-assign": "deny",
"eslint/no-extend-native": "deny",
"eslint/no-extra-bind": "deny",
"eslint/no-extra-boolean-cast": ["deny", { enforceForInnerExpressions: true }],
"eslint/no-extra-label": "deny",
"eslint/no-fallthrough": ["deny", {
allowEmptyCase: false,
reportUnusedFallthroughComment: true
}],
"eslint/no-func-assign": "deny",
"eslint/no-global-assign": "deny",
"eslint/no-implicit-coercion": ["deny", {
allow: [],
boolean: true,
disallowTemplateShorthand: false,
number: true,
string: true
}],
"eslint/no-import-assign": "deny",
"eslint/no-inline-comments": "deny",
"eslint/no-inner-declarations": [
"deny",
"both",
"disallow"
],
"eslint/no-invalid-regexp": "deny",
"eslint/no-irregular-whitespace": "deny",
"eslint/no-iterator": "deny",
"eslint/no-label-var": "deny",
"eslint/no-labels": "deny",
"eslint/no-lone-blocks": "deny",
"eslint/no-lonely-if": "deny",
"eslint/no-loop-func": "deny",
"eslint/no-loss-of-precision": "deny",
"eslint/no-magic-numbers": ["warn", {
detectObjects: true,
enforceConst: true,
ignoreEnums: true,
ignoreNumericLiteralTypes: true,
ignoreTypeIndexes: true
}],
"eslint/no-misleading-character-class": "deny",
"eslint/no-multi-assign": "deny",
"eslint/no-multi-str": "deny",
"eslint/no-negated-condition": "deny",
"eslint/no-nested-ternary": "deny",
"eslint/no-new": "deny",
"eslint/no-new-func": "deny",
"eslint/no-new-native-nonconstructor": "deny",
"eslint/no-new-wrappers": "deny",
"eslint/no-nonoctal-decimal-escape": "deny",
"eslint/no-obj-calls": "deny",
"eslint/no-object-constructor": "deny",
"eslint/no-param-reassign": ["deny", {
ignorePropertyModificationsFor: [],
props: true
}],
"eslint/no-plusplus": "deny",
"eslint/no-promise-executor-return": "deny",
"eslint/no-proto": "deny",
"eslint/no-prototype-builtins": "deny",
"eslint/no-redeclare": ["deny", { builtinGlobals: true }],
"eslint/no-regex-spaces": "deny",
"eslint/no-return-assign": ["deny", "always"],
"eslint/no-script-url": "deny",
"eslint/no-self-assign": ["deny", { props: true }],
"eslint/no-self-compare": "deny",
"eslint/no-sequences": ["deny", { allowInParentheses: false }],
"eslint/no-setter-return": "deny",
"eslint/no-shadow": ["deny", {
builtinGlobals: true,
hoist: "functions-and-types",
ignoreFunctionTypeParameterNameValueShadow: true,
ignoreOnInitialization: false,
ignoreTypeValueShadow: true
}],
"eslint/no-shadow-restricted-names": ["deny", { reportGlobalThis: true }],
"eslint/no-sparse-arrays": "deny",
"eslint/no-template-curly-in-string": "deny",
"eslint/no-ternary": "deny",
"eslint/no-this-before-super": "deny",
"eslint/no-throw-literal": "allow",
"eslint/no-unassigned-vars": "deny",
"eslint/no-undef": ["deny", { typeof: true }],
"eslint/no-undefined": "deny",
"eslint/no-unexpected-multiline": "deny",
"eslint/no-unmodified-loop-condition": "deny",
"eslint/no-unneeded-ternary": ["deny", { defaultAssignment: false }],
"eslint/no-unreachable": "deny",
"eslint/no-unsafe-finally": "deny",
"eslint/no-unsafe-negation": ["deny", { enforceForOrderingRelations: true }],
"eslint/no-unsafe-optional-chaining": ["deny", { disallowArithmeticOperators: true }],
"eslint/no-unused-expressions": ["deny", {
allowShortCircuit: false,
allowTaggedTemplates: false,
allowTernary: false,
enforceForJSX: true
}],
"eslint/no-unused-labels": "deny",
"eslint/no-unused-private-class-members": "deny",
"eslint/no-unused-vars": ["deny", {
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
fix: {
ignoreClassWithStaticInitBlock: false,
ignoreRestSiblings: false,
ignoreUsingDeclarations: false,
imports: "suggestion",
reportVarsOnlyUsedAsTypes: false,
variables: "suggestion",
vars: "all"
}
}],
"eslint/no-use-before-define": ["deny", {
allowNamedExports: false,
classes: true,
enums: true,
functions: true,
ignoreTypeReferences: true,
typedefs: true,
variables: true
}],
"eslint/no-useless-assignment": "deny",
"eslint/no-useless-backreference": "deny",
"eslint/no-useless-call": "deny",
"eslint/no-useless-catch": "deny",
"eslint/no-useless-computed-key": ["deny", { enforceForClassMembers: true }],
"eslint/no-useless-concat": "deny",
"eslint/no-useless-constructor": "deny",
"eslint/no-useless-escape": "deny",
"eslint/no-useless-rename": ["deny", {
ignoreDestructuring: false,
ignoreExport: false,
ignoreImport: false
}],
"eslint/no-useless-return": "deny",
"eslint/no-var": "deny",
"eslint/no-void": ["deny", { allowAsStatement: false }],
"eslint/no-warning-comments": ["warn", { location: "anywhere" }],
"eslint/no-with": "deny",
"eslint/operator-assignment": ["deny", "never"],
"eslint/prefer-const": ["deny", {
destructuring: "any",
ignoreReadBeforeAssign: true
}],
"eslint/prefer-destructuring": ["deny", {
AssignmentExpression: {
array: true,
object: true
},
enforceForRenamedProperties: false,
VariableDeclarator: {
array: true,
object: true
}
}],
"eslint/prefer-exponentiation-operator": "deny",
"eslint/prefer-numeric-literals": "deny",
"eslint/prefer-object-has-own": "deny",
"eslint/prefer-object-spread": "deny",
"eslint/prefer-promise-reject-errors": ["deny", { allowEmptyReject: false }],
"eslint/prefer-rest-params": "deny",
"eslint/prefer-spread": "deny",
"eslint/prefer-template": "deny",
"eslint/preserve-caught-error": "allow",
"eslint/radix": "deny",
"eslint/require-await": "allow",
"eslint/require-yield": "deny",
"eslint/sort-imports": "allow",
"eslint/sort-keys": "allow",
"eslint/sort-vars": "allow",
"eslint/symbol-description": "deny",
"eslint/unicode-bom": ["deny", "never"],
"eslint/use-isnan": ["deny", {
enforceForIndexOf: true,
enforceForSwitchCase: true
}],
"eslint/valid-typeof": ["deny", { requireStringLiterals: true }],
"eslint/vars-on-top": "deny",
"eslint/yoda": [
"deny",
"never",
{
exceptRange: false,
onlyEquality: false
}
]
};
//#endregion
//#region ../rules/functional.ts
const functionalRules = {
"functional/immutable-data": "deny",
"functional/no-let": "deny",
"functional/no-throw-statements": "deny",
"functional/no-try-statements": "deny",
"functional/prefer-property-signatures": "deny",
"functional/readonly-type": ["deny", "generic"]
};
//#endregion
//#region ../rules/import.ts
const MAX_DEPTH = 4294967295;
const importRules = {
"import/consistent-type-specifier-style": ["deny", "prefer-top-level"],
"import/default": "deny",
"import/export": "deny",
"import/exports-last": "deny",
"import/extensions": [
"deny",
"always",
{
checkTypeImports: true,
ignorePackages: true
}
],
"import/first": ["deny", "absolute-first"],
"import/group-exports": "deny",
"import/max-dependencies": "allow",
"import/named": "deny",
"import/namespace": ["deny", { allowComputed: false }],
"import/no-absolute-path": ["deny", {
amd: false,
commonjs: true,
esmodule: true
}],
"import/no-amd": "deny",
"import/no-anonymous-default-export": ["deny", {
allowAnonymousClass: false,
allowAnonymousFunction: false,
allowArray: false,
allowArrowFunction: false,
allowCallExpression: false,
allowLiteral: false,
allowNew: false,
allowObject: false
}],
"import/no-commonjs": ["deny", {
allowConditionalRequire: false,
allowPrimitiveModules: false,
allowRequire: false
}],
"import/no-cycle": ["deny", {
allowUnsafeDynamicCyclicDependency: false,
ignoreExternal: false,
ignoreTypes: true,
maxDepth: MAX_DEPTH
}],
"import/no-default-export": "allow",
"import/no-duplicates": ["deny", {
considerQueryString: true,
preferInline: false
}],
"import/no-dynamic-require": ["deny", { esmodule: true }],
"import/no-empty-named-blocks": "deny",
"import/no-mutable-exports": "deny",
"import/no-named-as-default": "deny",
"import/no-named-as-default-member": "deny",
"import/no-named-default": "deny",
"import/no-named-export": "allow",
"import/no-namespace": "deny",
"import/no-nodejs-modules": "allow",
"import/no-relative-parent-imports": "allow",
"import/no-self-import": "deny",
"import/no-unassigned-import": "deny",
"import/no-webpack-loader-syntax": "deny",
"import/prefer-default-export": ["deny", { target: "single" }],
"import/unambiguous": "deny"
};
//#endregion
//#region ../rules/jsdoc.ts
const jsDocRules = {
"jsdoc/check-access": "warn",
"jsdoc/check-property-names": "warn",
"jsdoc/check-tag-names": ["warn", {
definedTags: ["link"],
typed: true
}],
"jsdoc/empty-tags": "warn",
"jsdoc/implements-on-classes": "warn",
"jsdoc/no-defaults": ["warn", { noOptionalParamNames: true }],
"jsdoc/require-param": ["warn", {
checkConstructors: true,
checkDestructured: true,
checkDestructuredRoots: true,
checkGetters: true,
checkRestProperty: true,
checkSetters: true
}],
"jsdoc/require-param-description": "warn",
"jsdoc/require-param-name": "warn",
"jsdoc/require-param-type": "allow",
"jsdoc/require-property": "warn",
"jsdoc/require-property-description": "warn",
"jsdoc/require-property-name": "warn",
"jsdoc/require-property-type": "allow",
"jsdoc/require-returns": ["warn", {
checkConstructors: true,
checkGetters: true,
forceRequireReturn: true,
forceReturnsWithAsync: true
}],
"jsdoc/require-returns-description": "warn",
"jsdoc/require-returns-type": "allow",
"jsdoc/require-yields": ["warn", {
forceRequireYields: false,
withGeneratorTag: false
}]
};
//#endregion
//#region ../rules/node.ts
const nodeRules = {
"node/global-require": "deny",
"node/handle-callback-err": "allow",
"node/no-exports-assign": "deny",
"node/no-new-require": "deny",
"node/no-path-concat": "deny",
"node/no-process-env": "deny"
};
//#endregion
//#region ../rules/oxc.ts
const oxcRules = {
"oxc/approx-constant": "deny",
"oxc/bad-array-method-on-arguments": "deny",
"oxc/bad-bitwise-operator": "deny",
"oxc/bad-char-at-comparison": "deny",
"oxc/bad-comparison-sequence": "deny",
"oxc/bad-min-max-func": "deny",
"oxc/bad-object-literal-comparison": "deny",
"oxc/bad-replace-all-arg": "deny",
"oxc/branches-sharing-code": "warn",
"oxc/const-comparisons": "deny",
"oxc/double-comparisons": "deny",
"oxc/erasing-op": "deny",
"oxc/misrefactored-assign-op": "deny",
"oxc/missing-throw": "deny",
"oxc/no-accumulating-spread": "deny",
"oxc/no-async-await": "allow",
"oxc/no-async-endpoint-handlers": "allow",
"oxc/no-barrel-file": ["deny", { threshold: 100 }],
"oxc/no-const-enum": "deny",
"oxc/no-map-spread": "allow",
"oxc/no-optional-chaining": "allow",
"oxc/no-rest-spread-properties": "allow",
"oxc/no-this-in-exported-function": "deny",
"oxc/number-arg-out-of-range": "deny",
"oxc/only-used-in-recursion": "deny",
"oxc/uninvoked-array-callback": "deny"
};
//#endregion
//#region ../rules/perfectionist.ts
const perfectionistRules = {
"perfectionist/sort-array-includes": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-classes": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-decorators": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-enums": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-export-attributes": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-exports": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-heritage-clauses": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-import-attributes": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-interfaces": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-intersection-types": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-jsx-props": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-maps": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-modules": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-named-exports": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-named-imports": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-object-types": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-objects": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-sets": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-switch-case": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-union-types": ["deny", {
order: "asc",
type: "natural"
}],
"perfectionist/sort-variable-declarations": ["deny", {
order: "asc",
type: "natural"
}]
};
//#endregion
//#region ../rules/promise.ts
const promiseRules = {
"promise/always-return": ["deny", {
ignoreAssignmentVariable: ["globalThis"],
ignoreLastCallback: false
}],
"promise/avoid-new": "deny",
"promise/catch-or-return": ["deny", {
allowFinally: false,
allowThen: false,
terminationMethod: ["catch"]
}],
"promise/no-callback-in-promise": ["deny", {
callbacks: [
"callback",
"cb",
"done",
"next"
],
exceptions: [],
timeoutsErr: false
}],
"promise/no-multiple-resolved": "deny",
"promise/no-nesting": "deny",
"promise/no-new-statics": "deny",
"promise/no-promise-in-callback": "deny",
"promise/no-return-in-finally": "deny",
"promise/no-return-wrap": ["deny", { allowReject: false }],
"promise/param-names": ["deny", {
rejectPattern: "^_?reject$",
resolvePattern: "^_?resolve$"
}],
"promise/prefer-await-to-callbacks": "allow",
"promise/prefer-await-to-then": ["deny", { strict: true }],
"promise/prefer-catch": "deny",
"promise/spec-only": ["deny", { allowedMethods: [] }],
"promise/valid-params": "deny"
};
//#endregion
//#region ../rules/typescript.ts
/** Longueur minimale de la description accompagnat une directive (p. ex. `@ts-expect-error`). */
const MIN_DIRECTIVE_DESCRIPTION_LENGTH = 10;
const typeScriptRules = {
"typescript/adjacent-overload-signatures": "deny",
"typescript/array-type": ["deny", {
default: "generic",
readonly: "generic"
}],
"typescript/await-thenable": "deny",
"typescript/ban-ts-comment": ["deny", {
minimumDescriptionLength: MIN_DIRECTIVE_DESCRIPTION_LENGTH,
"ts-check": false,
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-nocheck": true
}],
"typescript/ban-tslint-comment": "deny",
"typescript/class-literal-property-style": ["deny", "fields"],
"typescript/consistent-generic-constructors": ["deny", { option: "constructor" }],
"typescript/consistent-indexed-object-style": ["deny", "record"],
"typescript/consistent-return": ["deny", { treatUndefinedAsUnspecified: false }],
"typescript/consistent-type-assertions": ["deny", { assertionStyle: "never" }],
"typescript/consistent-type-definitions": ["deny", "type"],
"typescript/consistent-type-exports": ["deny", { fixMixedExportsWithInlineTypeSpecifier: false }],
"typescript/consistent-type-imports": ["deny", {
disallowTypeAnnotations: true,
fixStyle: "separate-type-imports",
prefer: "type-imports"
}],
"typescript/dot-notation": ["deny", {
allowIndexSignaturePropertyAccess: false,
allowKeywords: false,
allowPattern: "",
allowPrivateClassPropertyAccess: false,
allowProtectedClassPropertyAccess: false
}],
"typescript/explicit-function-return-type": ["deny", {
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
allowDirectConstAssertionInArrowFunctions: true,
allowedNames: [],
allowExpressions: false,
allowFunctionsWithoutTypeParameters: false,
allowHigherOrderFunctions: true,
allowIIFEs: false,
allowTypedFunctionExpressions: true
}],
"typescript/explicit-module-boundary-types": ["deny", {
allowArgumentsExplicitlyTypedAsAny: false,
allowDirectConstAssertionInArrowFunctions: true,
allowedNames: [],
allowHigherOrderFunctions: true,
allowOverloadFunctions: false,
allowTypedFunctionExpressions: true
}],
"typescript/no-array-delete": "deny",
"typescript/no-base-to-string": ["deny", {
checkUnknown: true,
ignoredTypeNames: [
"deny",
"RegExp",
"URL",
"URLSearchParams"
]
}],
"typescript/no-confusing-non-null-assertion": "deny",
"typescript/no-confusing-void-expression": ["deny", {
ignoreArrowShorthand: false,
ignoreVoidOperator: false,
ignoreVoidReturningFunctions: false
}],
"typescript/no-deprecated": "deny",
"typescript/no-duplicate-enum-values": "deny",
"typescript/no-duplicate-type-constituents": ["deny", {
ignoreIntersections: false,
ignoreUnions: false
}],
"typescript/no-dynamic-delete": "deny",
"typescript/no-empty-interface": ["deny", { allowSingleExtends: false }],
"typescript/no-empty-object-type": ["deny", {
allowInterfaces: "never",
allowObjectTypes: "never"
}],
"typescript/no-explicit-any": ["deny", {
fixToUnknown: true,
ignoreRestArgs: false
}],
"typescript/no-extra-non-null-assertion": "deny",
"typescript/no-extraneous-class": ["deny", {
allowConstructorOnly: false,
allowEmpty: false,
allowStaticOnly: false,
allowWithDecorator: false
}],
"typescript/no-floating-promises": ["deny", {
allowForKnownSafeCalls: [],
allowForKnownSafePromises: [],
checkThenables: true,
ignoreIIFE: false,
ignoreVoid: false
}],
"typescript/no-for-in-array": "deny",
"typescript/no-implied-eval": "deny",
"typescript/no-import-type-side-effects": "deny",
"typescript/no-inferrable-types": ["deny", {
ignoreParameters: true,
ignoreProperties: true
}],
"typescript/no-invalid-void-type": ["deny", {
allowAsThisParameter: false,
allowInGenericTypeArguments: true
}],
"typescript/no-meaningless-void-operator": ["deny", { checkNever: true }],
"typescript/no-misused-new": "deny",
"typescript/no-misused-promises": ["deny", {
checksConditionals: true,
checksSpreads: true,
checksVoidReturn: true
}],
"typescript/no-misused-spread": ["deny", { allow: [] }],
"typescript/no-mixed-enums": "deny",
"typescript/no-namespace": ["deny", {
allowDeclarations: false,
allowDefinitionFiles: true
}],
"typescript/no-non-null-asserted-nullish-coalescing": "deny",
"typescript/no-non-null-asserted-optional-chain": "deny",
"typescript/no-non-null-assertion": "deny",
"typescript/no-redundant-type-constituents": "deny",
"typescript/no-require-imports": ["deny", {
allow: [],
allowAsImport: false
}],
"typescript/no-this-alias": ["deny", {
allowDestructuring: false,
allowedNames: []
}],
"typescript/no-unnecessary-boolean-literal-compare": "allow",
"typescript/no-unnecessary-condition": ["deny", {
allowConstantLoopConditions: "never",
checkTypePredicates: true
}],
"typescript/no-unnecessary-parameter-property-assignment": "deny",
"typescript/no-unnecessary-qualifier": "deny",
"typescript/no-unnecessary-template-expression": "deny",
"typescript/no-unnecessary-type-arguments": "deny",
"typescript/no-unnecessary-type-assertion": ["deny", {
checkLiteralConstAssertions: false,
typesToIgnore: []
}],
"typescript/no-unnecessary-type-constraint": "deny",
"typescript/no-unnecessary-type-conversion": "deny",
"typescript/no-unnecessary-type-parameters": "deny",
"typescript/no-unsafe-argument": "deny",
"typescript/no-unsafe-assignment": "deny",
"typescript/no-unsafe-call": "deny",
"typescript/no-unsafe-declaration-merging": "deny",
"typescript/no-unsafe-enum-comparison": "deny",
"typescript/no-unsafe-function-type": "deny",
"typescript/no-unsafe-member-access": ["deny", { allowOptionalChaining: false }],
"typescript/no-unsafe-return": "deny",
"typescript/no-unsafe-type-assertion": "deny",
"typescript/no-unsafe-unary-minus": "deny",
"typescript/no-useless-default-assignment": "deny",
"typescript/no-useless-empty-export": "deny",
"typescript/no-wrapper-object-types": "deny",
"typescript/non-nullable-type-assertion-style": "allow",
"typescript/only-throw-error": ["deny", {
allow: [],
allowRethrowing: true,
allowThrowingAny: false,
allowThrowingUnknown: false
}],
"typescript/parameter-properties": ["deny", { prefer: "class-property" }],
"typescript/prefer-as-const": "deny",
"typescript/prefer-enum-initializers": "deny",
"typescript/prefer-find": "deny",
"typescript/prefer-for-of": "deny",
"typescript/prefer-function-type": "deny",
"typescript/prefer-includes": "deny",
"typescript/prefer-literal-enum-member": ["deny", { allowBitwiseExpressions: false }],
"typescript/prefer-nullish-coalescing": ["deny", {
ignoreBooleanCoercion: false,
ignoreConditionalTests: true,
ignoreIfStatements: false,
ignoreMixedLogicalExpressions: false,
ignorePrimitives: false,
ignoreTernaryTests: false
}],
"typescript/prefer-optional-chain": ["deny", {
checkAny: true,
checkBigInt: true,
checkBoolean: true,
checkNumber: true,
checkString: true,
checkUnknown: true,
requireNullish: false
}],
"typescript/prefer-promise-reject-errors": ["deny", {
allowEmptyReject: false,
allowThrowingAny: false,
allowThrowingUnknown: false
}],
"typescript/prefer-readonly": ["deny", { onlyInlineLambdas: false }],
"typescript/prefer-readonly-parameter-types": ["allow", {
allow: [],
checkParameterProperties: true,
ignoreInferredTypes: true,
treatMethodsAsReadonly: false
}],
"typescript/prefer-reduce-type-parameter": "deny",
"typescript/prefer-regexp-exec": "deny",
"typescript/prefer-return-this-type": "deny",
"typescript/prefer-string-starts-ends-with": ["deny", { allowSingleElementEquality: "never" }],
"typescript/prefer-ts-expect-error": "allow",
"typescript/promise-function-async": ["deny", {
allowAny: false,
allowedPromiseNames: [],
checkArrowFunctions: true,
checkFunctionDeclarations: true,
checkFunctionExpressions: true,
checkMethodDeclarations: true
}],
"typescript/related-getter-setter-pairs": "deny",
"typescript/require-array-sort-compare": ["deny", { ignoreStringArrays: true }],
"typescript/require-await": "deny",
"typescript/restrict-plus-operands": ["deny", {
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: false,
allowRegExp: false
}],
"typescript/restrict-template-expressions": ["deny", {
allow: [{
from: "lib",
name: [
"Error",
"URL",
"URLSearchParams"
]
}],
allowAny: false,
allowBoolean: false,
allowNever: false,
allowNullish: false,
allowNumber: false,
allowRegExp: false
}],
"typescript/return-await": ["deny", "error-handling-correctness-only"],
"typescript/strict-boolean-expressions": ["deny", {
allowAny: false,
allowNullableBoolean: true,
allowNullableEnum: true,
allowNullableNumber: false,
allowNullableObject: false,
allowNullableString: false,
allowNumber: false,
allowString: false
}],
"typescript/strict-void-return": ["deny", { allowReturnAny: false }],
"typescript/switch-exhaustiveness-check": ["deny", {
allowDefaultCaseForExhaustiveSwitch: true,
considerDefaultExhaustiveForUnions: false,
defaultCaseCommentPattern: "@skip-exhaustive-check",
requireDefaultForNonUnion: false
}],
"typescript/triple-slash-reference": ["deny", {
lib: "never",
path: "never",
types: "prefer-import"
}],
"typescript/unbound-method": ["deny", { ignoreStatic: false }],
"typescript/unified-signatures": ["deny", {
ignoreDifferentlyNamedParameters: false,
ignoreOverloadsWithDifferentJSDoc: false
}],
"typescript/use-unknown-in-catch-callback-variable": "deny"
};
//#endregion
//#region ../rules/unicorn.ts
const unicornRules = {
"unicorn/catch-error-name": ["deny", { ignore: ["_"] }],
"unicorn/consistent-assert": "deny",
"unicorn/consistent-date-clone": "deny",
"unicorn/consistent-empty-array-spread": "deny",
"unicorn/consistent-existence-index-check": "deny",
"unicorn/consistent-function-scoping": ["deny", { checkArrowFunctions: true }],
"unicorn/custom-error-definition": "deny",
"unicorn/empty-brace-spaces": "deny",
"unicorn/error-message": "deny",
"unicorn/escape-case": "deny",
"unicorn/explicit-length-check": ["deny", { "non-zero": "not-equal" }],
"unicorn/filename-case": ["deny", {
case: "kebabCase",
ignore: "",
multipleFileExtensions: true
}],
"unicorn/new-for-builtins": "deny",
"unicorn/no-abusive-eslint-disable": "deny",
"unicorn/no-accessor-recursion": "deny",
"unicorn/no-anonymous-default-export": "deny",
"unicorn/no-array-callback-reference": "allow",
"unicorn/no-array-for-each": "allow",
"unicorn/no-array-method-this-argument": "allow",
"unicorn/no-array-reduce": "allow",
"unicorn/no-array-reverse": ["deny", { allowExpressionStatement: false }],
"unicorn/no-array-sort": ["deny", { allowExpressionStatement: false }],
"unicorn/no-await-expression-member": "deny",
"unicorn/no-await-in-promise-methods": "deny",
"unicorn/no-console-spaces": "deny",
"unicorn/no-document-cookie": "deny",
"unicorn/no-empty-file": "deny",
"unicorn/no-hex-escape": "deny",
"unicorn/no-immediate-mutation": "deny",
"unicorn/no-instanceof-array": "deny",
"unicorn/no-instanceof-builtins": ["deny", {
exlude: [],
include: [],
strategy: "strict",
useErrorIsError: true
}],
"unicorn/no-invalid-fetch-options": "deny",
"unicorn/no-invalid-remove-event-listener": "deny",
"unicorn/no-length-as-slice-end": "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",
"unicorn/no-new-array": "deny",
"unicorn/no-new-buffer": "deny",
"unicorn/no-null": ["deny", { checkStrictEquality: true }],
"unicorn/no-object-as-default-parameter": "deny",
"unicorn/no-process-exit": "deny",
"unicorn/no-single-promise-in-promise-methods": "deny",
"unicorn/no-static-only-class": "deny",
"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",
"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",
"unicorn/no-useless-fallback-in-spread": "deny",
"unicorn/no-useless-iterator-to-array": "deny",
"unicorn/no-useless-length-check": "deny",
"unicorn/no-useless-promise-resolve-reject": ["deny", { allowReject: false }],
"unicorn/no-useless-spread": "deny",
"unicorn/no-useless-switch-case": "deny",
"unicorn/no-useless-undefined": "deny",
"unicorn/no-zero-fractions": "deny",
"unicorn/number-literal-case": "deny",
"unicorn/numeric-separators-style": ["deny", {
binary: {
groupLength: 3,
minimumDigits: 4
},
hexadecimal: {
groupLength: 3,
minimumDigits: 4
},
number: {
groupLength: 3,
minimumDigits: 4
},
octal: {
groupLength: 3,
minimumDigits: 4
},
onlyIfContainsSeparator: false
}],
"unicorn/prefer-add-event-listener": "deny",
"unicorn/prefer-array-find": "deny",
"unicorn/prefer-array-flat": "deny",
"unicorn/prefer-array-flat-map": "deny",
"unicorn/prefer-array-index-of": "deny",
"unicorn/prefer-array-some": "deny",
"unicorn/prefer-at": ["deny", {
checkAllIndexAccess: true,
getLastElementFunctions: []
}],
"unicorn/prefer-bigint-literals": "deny",
"unicorn/prefer-blob-reading-methods": "deny",
"unicorn/prefer-class-fields": "deny",
"unicorn/prefer-classlist-toggle": "deny",
"unicorn/prefer-code-point": "deny",
"unicorn/prefer-date-now": "deny",
"unicorn/prefer-default-parameters": "deny",
"unicorn/prefer-dom-node-append": "deny",
"unicorn/prefer-dom-node-dataset": "allow",
"unicorn/prefer-dom-node-remove": "deny",
"unicorn/prefer-dom-node-text-content": "deny",
"unicorn/prefer-event-target": "deny",
"unicorn/prefer-global-this": "deny",
"unicorn/prefer-import-meta-properties": "deny",
"unicorn/prefer-includes": "deny",
"unicorn/prefer-keyboard-event-key": "deny",
"unicorn/prefer-logical-operator-over-ternary": "deny",
"unicorn/prefer-math-min-max": "deny",
"unicorn/prefer-math-trunc": "deny",
"unicorn/prefer-modern-dom-apis": "deny",
"unicorn/prefer-modern-math-apis": "deny",
"unicorn/prefer-module": "deny",
"unicorn/prefer-native-coercion-functions": "deny",
"unicorn/prefer-negative-index": "deny",
"unicorn/prefer-node-protocol": "deny",
"unicorn/prefer-number-properties": ["deny", {
checkInfinity: true,
checkNaN: true
}],
"unicorn/prefer-object-from-entries": "deny",
"unicorn/prefer-optional-catch-binding": "deny",
"unicorn/prefer-prototype-methods": "deny",
"unicorn/prefer-query-selector": "deny",
"unicorn/prefer-reflect-apply": "deny",
"unicorn/prefer-regexp-test": "deny",
"unicorn/prefer-response-static-json": "deny",
"unicorn/prefer-set-has": "deny",
"unicorn/prefer-set-size": "deny",
"unicorn/prefer-spread": "deny",
"unicorn/prefer-string-raw": "deny",
"unicorn/prefer-string-replace-all": "deny",
"unicorn/prefer-string-slice": "deny",
"unicorn/prefer-string-starts-ends-with": "deny",
"unicorn/prefer-string-trim-start-end": "deny",
"unicorn/prefer-structured-clone": "deny",
"unicorn/prefer-ternary": "allow",
"unicorn/prefer-top-level-await": "deny",
"unicorn/prefer-type-error": "deny",
"unicorn/relative-url-style": ["deny", "always"],
"unicorn/require-array-join-separator": "deny",
"unicorn/require-module-attributes": "deny",
"unicorn/require-module-specifiers": "deny",
"unicorn/require-number-to-fixed-digits-argument": "deny",
"unicorn/require-post-message-target-origin": "deny",
"unicorn/switch-case-braces": ["deny", "avoid"],
"unicorn/switch-case-break-position": "deny",
"unicorn/text-encoding-identifier-case": "deny",
"unicorn/throw-new-error": "deny"
};
//#endregion
//#region ../index.ts
const config = defineConfig({
categories: {
correctness: "off",
nursery: "off",
pedantic: "off",
perf: "off",
style: "off",
suspicious: "off"
},
env: {
browser: true,
builtin: true,
es2026: true,
node: true
},
ignorePatterns: [
".astro",
".cache",
"dist/**/*"
],
jsPlugins: ["eslint-plugin-functional", "eslint-plugin-perfectionist"],
options: {
reportUnusedDisableDirectives: "warn",
typeAware: true,
typeCheck: false
},
overrides: [astroConfig],
plugins: [
"import",
"jsdoc",
"node",
"oxc",
"promise",
"typescript",
"unicorn"
],
rules: {
...esLintRules,
...functionalRules,
...importRules,
...jsDocRules,
...nodeRules,
...oxcRules,
...perfectionistRules,
...promiseRules,
...typeScriptRules,
...unicornRules
},
settings: {}
});
//#endregion
export { config as default };