@addon24/eslint-config
Version:
ESLint configuration rules for WorldOfTextcraft projects - Centralized configuration for all project types
114 lines (112 loc) • 4.68 kB
JavaScript
/**
* TypeScript Advanced Rules
*
* Erweiterte TypeScript-Regeln für Backend-Projekte
*/
export default {
rules: {
// TypeScript-Advanced-Regeln
"@typescript-eslint/array-type": ["error", {
default: "array-simple",
readonly: "array-simple"
}],
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
"@typescript-eslint/consistent-type-assertions": ["error", {
assertionStyle: "as",
objectLiteralTypeAssertions: "never"
}],
"@typescript-eslint/no-base-to-string": ["error", {
ignoredTypeNames: ["Error", "RegExp", "URL", "URLSearchParams"]
}],
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": ["error", {
ignoreArrowShorthand: false,
ignoreVoidOperator: false
}],
"@typescript-eslint/no-duplicate-type-constituents": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-extraneous-class": ["error", {
allowConstructorOnly: false,
allowEmpty: false,
allowStaticOnly: false,
allowWithDecorator: false
}],
"@typescript-eslint/no-invalid-void-type": ["error", {
allowInGenericTypeArguments: false,
allowAsThisParameter: false
}],
"@typescript-eslint/no-meaningless-void-operator": ["error", {
checkNever: true
}],
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error", {
allowComparingNullableBooleansToTrue: false,
allowComparingNullableBooleansToFalse: false
}],
"@typescript-eslint/no-unnecessary-condition": ["error", {
allowConstantLoopConditions: false,
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false
}],
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-readonly-parameter-types": "off", // Zu strikt für Backend-Entwicklung
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-return-this-type": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": ["error", {
allowNumber: true,
allowBoolean: true,
allowAny: false,
allowNullish: false,
allowRegExp: false
}],
"@typescript-eslint/sort-type-constituents": "error",
"@typescript-eslint/strict-boolean-expressions": ["error", {
allowString: false,
allowNumber: false,
allowNullableObject: false,
allowNullableBoolean: false,
allowNullableString: false,
allowNullableNumber: false,
allowAny: false
}],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@stylistic/type-annotation-spacing": "error",
"@typescript-eslint/typedef": ["error", {
arrayDestructuring: false,
arrowParameter: false,
memberVariableDeclaration: true,
objectDestructuring: false,
parameter: true,
propertyDeclaration: true,
variableDeclaration: false,
variableDeclarationIgnoreFunction: false
}],
"@typescript-eslint/unbound-method": ["error", {
ignoreStatic: true
}],
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/prefer-enum-initializers": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/return-await": ["error", "always"],
},
};