Skip to content

Dangerjs fail when I try to split dangerfile to small parts #1153

Answered by fbartho
Sly777 asked this question in Q&A
Discussion options

You must be logged in to vote

Here's an example from one of the repos I work on

Every file in scripts/danger/lib is imported into the Dangerfiles (main.ts/graphql.ts)
Each one starts with import "./danger-import"

And the contents of danger-import.ts are:

// DangerJS has a weird compile/runtime environment, but this is a stable detail!
// Extra files that want to import danger need this to make typescript happy.
//
// Briefly documented here:
// https://github.com/danger/danger-js/blob/main/docs/usage/extending-danger.html.md#writing-your-plugin

import type { DangerRuntimeContainer, Scheduleable } from "danger";
import type { DangerDSLType } from "danger/distribution/dsl/DangerDSL";

export {};

// Provides dev-time …

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@gigamac
Comment options

@fbartho
Comment options

@gigamac
Comment options

@fbartho
Comment options

Answer selected by fbartho
@gigamac
Comment options

@wilhen01
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #1152 on September 14, 2021 07:36.