mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Lint to restrict @n8n/typeorm to persistence layer (no-changelog) (#9840)
This commit is contained in:
@@ -422,6 +422,32 @@ module.exports = {
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
'misplaced-n8n-typeorm-import': {
|
||||
meta: {
|
||||
type: 'error',
|
||||
docs: {
|
||||
description:
|
||||
'Ensure `@n8n/typeorm` is imported only from within the `packages/cli/src/databases` directory.',
|
||||
recommended: 'error',
|
||||
},
|
||||
messages: {
|
||||
moveImport: 'Move this import to `packages/cli/src/databases/**/*.ts`.',
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
return {
|
||||
ImportDeclaration(node) {
|
||||
if (
|
||||
node.source.value === '@n8n/typeorm' &&
|
||||
!context.getFilename().includes('packages/cli/src/databases/')
|
||||
) {
|
||||
context.report({ node, messageId: 'moveImport' });
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const isJsonParseCall = (node) =>
|
||||
|
||||
Reference in New Issue
Block a user