mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
[Dev] Add non type imports depcruiser check (#5901)
* Forbid non type imports in type and enum files * Allow orphans in src/@types
This commit is contained in:
parent
9dcb904649
commit
fb6d6f5b69
@ -1,6 +1,17 @@
|
||||
/** @type {import('dependency-cruiser').IConfiguration} */
|
||||
module.exports = {
|
||||
forbidden: [
|
||||
{
|
||||
name: "only-type-imports",
|
||||
severity: "error",
|
||||
comment: "Files in enums and @types may only use type imports.",
|
||||
from: {
|
||||
path: ["(^|/)src/@types", "(^|/)src/enums"],
|
||||
},
|
||||
to: {
|
||||
dependencyTypesNot: ["type-only"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "no-circular-at-runtime",
|
||||
severity: "warn",
|
||||
@ -31,6 +42,8 @@ module.exports = {
|
||||
"[.]d[.]ts$", // TypeScript declaration files
|
||||
"(^|/)tsconfig[.]json$", // TypeScript config
|
||||
"(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
|
||||
// anything in src/@types
|
||||
"(^|/)src/@types/",
|
||||
],
|
||||
},
|
||||
to: {},
|
||||
|
Loading…
Reference in New Issue
Block a user