// Removed require comment
See original GitHub issueHowdy! Today we encountered a fun little comment in our dangerfile.js
:
// Removed require
-let { danger, fail, warn, message } = require('danger')
+// Removed require
We were trying to figure out where this comment came from (and why it’s trying to remove code from our project) and couldn’t reproduce it locally what-so-ever. Oddly enough, it only came up in our CI process (we automatically push changes from a certain stage in our CI pipeline and this was in it). We thought it was possibly our eslint plugins so we scoured that source code, we also looked at prettier thinking it added it. For a while we couldn’t figure out where it came from until we thought it was maybe danger itself doing it. Lo-and-behold, we found out it is 😸
Unfortunately, we spent a bit of time doing this. I’m making this issue for two reasons:
- Google. We couldn’t find any google results when searching for
// Removed require
so hopefully find this and get their answers solved faster! - A possible solution:
I think it might be best to change the comment to not just // Removed require
, but also add another comment with a link to some sort of document or github issue that mentions why the comment is necessary. If this was there we would have found out a lot sooner and not feel like we accidentally created a sentient AI that removed code and mocked us in the process by leaving a comment 👍
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
I think this is now fixed with 2.0’s release 👍 (it does everything in-memory instead of editing the existing file )
Cool, thanks for the info. We have a working solution for now which I’ve documented for our team. I think this may trip up others though, especially if they’re setting up a non-JS/TS project and aren’t super familiar with TS/JS.