@addon24/eslint-config
Version:
ESLint configuration rules for WorldOfTextcraft projects - Centralized configuration for all project types
112 lines (109 loc) • 3.67 kB
JavaScript
/**
* TypeScript Core Rules
*
* Grundlegende TypeScript-Regeln für alle Backend-Projekte
* Basierend auf den ursprünglichen Backend-Regeln
*/
export default {
rules: {
// Ursprüngliche Backend TypeScript-Regeln
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
// TypeORM-Regeln nur im Backend aktivieren (siehe configs/backend.js)
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["strictCamelCase"],
},
{
selector: ["class"],
format: ["StrictPascalCase"],
},
{
selector: ["enum", "interface", "typeAlias"],
format: ["StrictPascalCase"],
},
{
selector: ["enumMember"],
format: ["StrictPascalCase"],
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "typeParameter",
format: ["PascalCase"],
custom: {
regex: "^[A-Z]$",
match: true,
},
},
{
selector: "import",
format: null,
},
{
selector: "property",
filter: {
regex: "^(allowEIO3|allowEio3|addTrailingSlash|maxHttpBufferSize|perMessageDeflate|pingInterval|pingTimeout|connectTimeout|upgradeTimeout|httpCompression|timestampRequests|timestampParam|forceBase64|withCredentials|rememberUpgrade|randomizationFactor|reconnectionAttempts|reconnectionDelay|reconnectionDelayMax|autoConnect|forceNew)$",
match: true,
},
format: null,
},
],
"@typescript-eslint/max-params": [
"error",
{
max: 10,
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/object-literal-sort-keys": "off",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/class-methods-use-this": "off",
},
};