website refactor
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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)',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user