Cleanup last known self imports (#19067)
* clean up self imports in workspace module * clean up media type self imports * fix self imports in property action module * fix self imports in propety editor module * Update index.js * lower threshold
This commit is contained in:
@@ -3,7 +3,7 @@ import path from 'path';
|
||||
import { createImportMap } from '../importmap/index.js';
|
||||
|
||||
const ILLEGAL_CORE_IMPORTS_THRESHOLD = 6;
|
||||
const SELF_IMPORTS_THRESHOLD = 4;
|
||||
const SELF_IMPORTS_THRESHOLD = 0;
|
||||
|
||||
const clientProjectRoot = path.resolve(import.meta.dirname, '../../');
|
||||
const modulePrefix = '@umbraco-cms/backoffice/';
|
||||
@@ -141,6 +141,8 @@ function reportIllegalImportsFromCore() {
|
||||
throw new Error(
|
||||
`Illegal imports found in ${total} core modules. ${total - ILLEGAL_CORE_IMPORTS_THRESHOLD} more than the threshold.`,
|
||||
);
|
||||
} else if (total === 0) {
|
||||
console.log(`✅ Success! No illegal imports found.`);
|
||||
} else {
|
||||
console.log(
|
||||
`✅ Success! Still (${total}) under the threshold of ${ILLEGAL_CORE_IMPORTS_THRESHOLD} illegal imports. `,
|
||||
@@ -167,15 +169,16 @@ function reportSelfImportsFromModules() {
|
||||
|
||||
// If there are self imports, log them
|
||||
console.error(`🚨 ${alias} is importing itself`);
|
||||
console.log(`\n`);
|
||||
total++;
|
||||
});
|
||||
|
||||
console.log(`\n`);
|
||||
|
||||
if (total > SELF_IMPORTS_THRESHOLD) {
|
||||
throw new Error(
|
||||
`Self imports found in ${total} modules. ${total - SELF_IMPORTS_THRESHOLD} more than the threshold.`,
|
||||
);
|
||||
} else if (total === 0) {
|
||||
console.log(`✅ Success! No self imports found.`);
|
||||
} else {
|
||||
console.log(`✅ Success! Still (${total}) under the threshold of ${SELF_IMPORTS_THRESHOLD} self imports.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user