website refactor

This commit is contained in:
2026-01-21 18:03:56 +01:00
parent 02987f60c8
commit 69319ce1d4
4 changed files with 51 additions and 43 deletions

View File

@@ -93,6 +93,7 @@ module.exports = {
'services-no-external-api': servicesRules['no-external-api-in-services'],
'services-must-be-pure': servicesRules['services-must-be-pure'],
'services-must-return-result': cleanErrorHandling,
'services-must-be-marked': servicesImplementContract,
// Client-Only Rules
'client-only-no-server-code': clientOnlyRules['no-server-code-in-client-only'],

View File

@@ -32,7 +32,13 @@ module.exports = {
'apps/website/index.ts', // Root entry
];
if (isIndexFile && !allowedPaths.some(path => filename.endsWith(path))) {
// Check if the filename ends with any of the allowed paths
// The filename is an absolute path, so we need to check if it contains the relative path
const isAllowedPath = allowedPaths.some(allowedPath => {
return filename.endsWith(allowedPath) || filename.includes('/' + allowedPath);
});
if (isIndexFile && !isAllowedPath) {
context.report({
node: null, // Report on the file level
loc: { line: 1, column: 0 },

View File

@@ -27,6 +27,7 @@ module.exports = {
mustUseDomainError: 'Error types must be DomainError objects, not strings',
noConstructorParams: 'Services must be self-contained. Constructor cannot have parameters. Dependencies should be created inside the constructor.',
mustImplementContract: 'Services must explicitly implement Service<TApiDto, TError> interface',
servicesMustBeMarked: 'Services must be explicitly marked with @Service decorator or similar (placeholder for services-must-be-marked)',
},
},