Update ESLint Configuration and Clean Up Scripts
- Adjusted ESLint configuration to improve clarity in import rules, specifically preventing deep imports from the domain. - Removed unnecessary blank lines in `check-domain-imports.mjs`, `check-exports.mjs`, and `codemod-domain-imports.mjs` scripts for better code cleanliness and maintainability. - Enhanced readability of the import validation message in ESLint configuration.
This commit is contained in:
parent
fd5336f499
commit
a699080610
@ -230,7 +230,8 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
group: ["@customer-portal/domain/*/*", "!@customer-portal/domain/*/providers"],
|
group: ["@customer-portal/domain/*/*", "!@customer-portal/domain/*/providers"],
|
||||||
message: "No deep @customer-portal/domain imports. Use @customer-portal/domain/<module> only.",
|
message:
|
||||||
|
"No deep @customer-portal/domain imports. Use @customer-portal/domain/<module> only.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
group: ["@customer-portal/domain/*/providers/*"],
|
group: ["@customer-portal/domain/*/providers/*"],
|
||||||
|
|||||||
@ -142,5 +142,3 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await main();
|
await main();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,5 +22,3 @@ if (wildcardKeys.length > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log("[domain] OK: package.json exports contains no wildcard keys.");
|
console.log("[domain] OK: package.json exports contains no wildcard keys.");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,9 @@ function replaceCommonProviderTypes(code) {
|
|||||||
(m, spec) => {
|
(m, spec) => {
|
||||||
const s = String(spec);
|
const s = String(spec);
|
||||||
const needsMove =
|
const needsMove =
|
||||||
s.includes("WhmcsResponse") || s.includes("WhmcsErrorResponse") || s.includes("SalesforceResponse");
|
s.includes("WhmcsResponse") ||
|
||||||
|
s.includes("WhmcsErrorResponse") ||
|
||||||
|
s.includes("SalesforceResponse");
|
||||||
if (!needsMove) return m;
|
if (!needsMove) return m;
|
||||||
return `import type {${spec}} from "@customer-portal/domain/common/providers";`;
|
return `import type {${spec}} from "@customer-portal/domain/common/providers";`;
|
||||||
}
|
}
|
||||||
@ -54,7 +56,9 @@ function replaceCommonProviderTypes(code) {
|
|||||||
(m, spec) => {
|
(m, spec) => {
|
||||||
const s = String(spec);
|
const s = String(spec);
|
||||||
const needsMove =
|
const needsMove =
|
||||||
s.includes("WhmcsResponse") || s.includes("WhmcsErrorResponse") || s.includes("SalesforceResponse");
|
s.includes("WhmcsResponse") ||
|
||||||
|
s.includes("WhmcsErrorResponse") ||
|
||||||
|
s.includes("SalesforceResponse");
|
||||||
if (!needsMove) return m;
|
if (!needsMove) return m;
|
||||||
return `import type {${spec}} from '@customer-portal/domain/common/providers';`;
|
return `import type {${spec}} from '@customer-portal/domain/common/providers';`;
|
||||||
}
|
}
|
||||||
@ -125,5 +129,3 @@ for (const dir of TARGET_DIRS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log(`codemod-domain-imports: updated ${changedFiles} file(s)`);
|
console.log(`codemod-domain-imports: updated ${changedFiles} file(s)`);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user