mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +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} */
|
/** @type {import('dependency-cruiser').IConfiguration} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
forbidden: [
|
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",
|
name: "no-circular-at-runtime",
|
||||||
severity: "warn",
|
severity: "warn",
|
||||||
@ -31,6 +42,8 @@ module.exports = {
|
|||||||
"[.]d[.]ts$", // TypeScript declaration files
|
"[.]d[.]ts$", // TypeScript declaration files
|
||||||
"(^|/)tsconfig[.]json$", // TypeScript config
|
"(^|/)tsconfig[.]json$", // TypeScript config
|
||||||
"(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
|
"(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
|
||||||
|
// anything in src/@types
|
||||||
|
"(^|/)src/@types/",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
to: {},
|
to: {},
|
||||||
|
Loading…
Reference in New Issue
Block a user