Added lefthook to enforce no non-type export in src/@types

This commit is contained in:
Bertie690 2025-06-06 23:10:22 -04:00
parent 88e4ab978b
commit f3f746ebdc

View File

@ -1,6 +1,18 @@
/** @type {import('dependency-cruiser').IConfiguration} */ /** @type {import('dependency-cruiser').IConfiguration} */
module.exports = { module.exports = {
forbidden: [ forbidden: [
{
name: "no-non-type-@type-exports",
severity: "error",
comment:
"Files in @types should not export anything but types and interfaces. " +
"The folder is intended to house imports that are removed at runtime, " +
"and thus should not contain anything with a bearing on runtime code.",
to: {
path: "(^|/)src/@types",
dependencyTypesNot: ["type-only"],
},
},
{ {
name: "only-type-imports", name: "only-type-imports",
severity: "error", severity: "error",