Hey there, it looks like you're trying to import the danger module. Turns out
that the code you write in a Dangerfile.js is actually a bit of a sneaky hack.
When running Danger, the import or require for Danger is removed before the code
is evaluated. Instead all of the imports are added to the global runtime, so if
you are importing Danger to use one of it's functions - you should instead just
use the global object for the root DSL elements.
There is a spectrum thread for discussion here:
- https://spectrum.chat/?t=0a005b56-31ec-4919-9a28-ced623949d4d
That spectrum link doesn't exist anymore.
To Reproduce
Steps to reproduce the behavior:
Add this line in a danger.ts: import { danger } from 'danger';
Run Danger
Expected behavior
Get a warning with a non-dead link, or amend the warning message so the link isn't needed.
Screenshots
If applicable, add screenshots to help explain your problem.
Your Environment
software
version
danger.js
12.3.3
node
18.20.4
npm
10.7.0
Operating System
MacOS
Additional context
Add any other context about the problem here.
Describe the bug When I use an import statement like this:
I get the warning message described here https://github.com/danger/danger-js/blob/491bb0b401148366cbe0e4d2bc9705fea521a647/source/danger.ts#L13C5-L13C66
That spectrum link doesn't exist anymore.
To Reproduce Steps to reproduce the behavior:
danger.ts
:import { danger } from 'danger';
Expected behavior
Get a warning with a non-dead link, or amend the warning message so the link isn't needed.
Screenshots If applicable, add screenshots to help explain your problem.
Your Environment
Additional context Add any other context about the problem here.