refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -43,6 +43,118 @@
]
}
},
{
"files": ["core/*/application/ports/*/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSInterfaceDeclaration[id.name=/^Get.*Port$/]",
"message": "Port interface names should not start with 'Get'. Use descriptive names without the 'Get' prefix."
}
]
}
},
{
"files": ["core/**/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/Blocker$/], TSInterfaceDeclaration[id.name=/Blocker$/]",
"message": "Blocker classes/interfaces are not allowed in core. Use Guards in backend."
},
{
"selector": "TSClassDeclaration[id.name=/Presenter$/], TSInterfaceDeclaration[id.name=/Presenter$/]",
"message": "Presenter classes/interfaces are not allowed in core. Presenters belong in API or frontend layers."
},
{
"selector": "TSClassDeclaration[id.name=/Dto$/], TSInterfaceDeclaration[id.name=/Dto$/]",
"message": "DTO classes/interfaces are not allowed in core. DTOs belong in API or frontend layers."
},
{
"selector": "TSClassDeclaration[id.name=/ViewModel$/], TSInterfaceDeclaration[id.name=/ViewModel$/]",
"message": "ViewModel classes/interfaces are not allowed in core. View Models belong in frontend."
},
{
"selector": "TSClassDeclaration[id.name=/CommandModel$/], TSInterfaceDeclaration[id.name=/CommandModel$/]",
"message": "CommandModel classes/interfaces are not allowed in core. Command Models belong in frontend."
}
]
}
},
{
"files": ["apps/website/**/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/Guard$/], TSInterfaceDeclaration[id.name=/Guard$/]",
"message": "Guard classes/interfaces are not allowed in frontend. Use Blockers in frontend."
}
]
}
},
{
"files": ["apps/api/**/*.ts", "apps/website/lib/dtos/**/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSEnumDeclaration[id.name=/^(?!.*Enum$).+/]",
"message": "Transport enums must end with 'Enum'."
}
]
}
},
{
"files": ["core/*/application/use-cases/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/^(?!.*UseCase$).+/]",
"message": "Use Case classes must end with 'UseCase'."
}
]
}
},
{
"files": ["core/*/application/services/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/^(?!.*Service$).+/]",
"message": "Application Service classes must end with 'Service'."
}
]
}
},
{
"files": ["apps/website/lib/view-models/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/^(?!.*ViewModel$).+/]",
"message": "View Model classes must end with 'ViewModel'."
}
]
}
},
{
"files": ["apps/website/lib/commands/*.ts"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSClassDeclaration[id.name=/^(?!.*CommandModel$).+/]",
"message": "Command Model classes must end with 'CommandModel'."
}
]
}
},
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",