2026-04-03

- eslint OK
- import OK
- jsdoc OK
- node OK
- oxc OK
- promise OK
This commit is contained in:
gcch 2026-04-03 23:57:57 +02:00
commit fab3d73813
13 changed files with 691 additions and 209 deletions

548
dist/index.mjs vendored
View file

@ -68,17 +68,6 @@ const astroConfig = {
},
};
//#endregion
//#region ../rules/functional.ts
const functionalRules = {
"functional/immutable-data": "error",
"functional/no-let": "error",
"functional/no-throw-statements": "error",
"functional/no-try-statements": "error",
"functional/prefer-property-signatures": "error",
"functional/readonly-type": ["error", "generic"],
};
//#endregion
//#region ../rules/eslint.ts
const esLintRules = {
@ -375,24 +364,304 @@ const esLintRules = {
],
};
//#endregion
//#region ../rules/functional.ts
const functionalRules = {
"functional/immutable-data": "error",
"functional/no-let": "error",
"functional/no-throw-statements": "error",
"functional/no-try-statements": "error",
"functional/prefer-property-signatures": "error",
"functional/readonly-type": ["error", "generic"],
};
//#endregion
//#region ../rules/import.ts
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: 4294967295,
},
],
"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": "deny",
"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"] }],
"jsdoc/check-tag-names": [
"warn",
{
definedTags: ["link"],
typed: true,
},
],
"jsdoc/empty-tags": "warn",
"jsdoc/implements-on-classes": "warn",
"jsdoc/no-defaults": "warn",
"jsdoc/require-param": "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": "warn",
"jsdoc/require-property": "warn",
"jsdoc/require-property-description": "warn",
"jsdoc/require-property-name": "warn",
"jsdoc/require-returns": "warn",
"jsdoc/require-property-type": "warn",
"jsdoc/require-returns": [
"warn",
{
checkConstructors: true,
checkGetters: true,
forceRequireReturn: true,
forceReturnsWithAsync: true,
},
],
"jsdoc/require-returns-description": "warn",
"jsdoc/require-yields": "warn",
"jsdoc/require-returns-type": "warn",
"jsdoc/require-yields": [
"warn",
{
forceRequireYields: false,
withGeneratorTag: false,
},
],
};
//#endregion
//#region ../rules/perfectionist.ts
const perfectionistRules = {
"perfectionist/sort-array-includes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-classes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-decorators": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-enums": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-export-attributes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-exports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-heritage-clauses": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-import-attributes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-interfaces": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-intersection-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-jsx-props": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-maps": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-modules": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-named-exports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-named-imports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-object-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-objects": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-sets": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-switch-case": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-union-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-variable-declarations": [
"error",
{
order: "asc",
type: "natural",
},
],
};
//#endregion
@ -610,158 +879,6 @@ const sonarJsRules = {
"sonarjs/xml-parser-xxe": "error",
};
//#endregion
//#region ../rules/perfectionist.ts
const perfectionistRules = {
"perfectionist/sort-array-includes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-classes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-decorators": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-enums": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-export-attributes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-exports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-heritage-clauses": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-import-attributes": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-interfaces": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-intersection-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-jsx-props": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-maps": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-modules": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-named-exports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-named-imports": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-object-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-objects": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-sets": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-switch-case": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-union-types": [
"error",
{
order: "asc",
type: "natural",
},
],
"perfectionist/sort-variable-declarations": [
"error",
{
order: "asc",
type: "natural",
},
],
};
//#endregion
//#region ../rules/typescript.ts
const typeScriptRules = {
@ -990,6 +1107,95 @@ const unicornRules = {
"unicorn/throw-new-error": "error",
};
//#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/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": "deny",
"promise/prefer-await-to-then": ["deny", { strict: true }],
"promise/prefer-catch": "deny",
"promise/spec-only": ["deny", { allowedMethods: [] }],
"promise/valid-params": "deny",
};
//#endregion
//#region ../index.ts
const config = defineConfig({
@ -1019,9 +1225,13 @@ const config = defineConfig({
rules: {
...esLintRules,
...functionalRules,
...importRules,
...jsDocRules,
...sonarJsRules,
...nodeRules,
...oxcRules,
...perfectionistRules,
...promiseRules,
...sonarJsRules,
...typeScriptRules,
...unicornRules,
},