forked from typescript-cheatsheets/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdangerfile.js
More file actions
19 lines (16 loc) · 715 Bytes
/
dangerfile.js
File metadata and controls
19 lines (16 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const { readFileSync } = require("fs");
const spellcheck = require("danger-plugin-spellcheck").default;
const edited = [...danger.git.modified_files, ...danger.git.created_files];
edited.forEach((file) => {
const content = readFileSync(file, "utf8");
if (content.includes("Typescript")) {
const fileURL = danger.github.utils.fileLinks([file])[0];
warn(
`Found "Typescript" in ${fileURL} - you want to [use "TypeScript"](https://www.staging-typescript.org/branding)`
);
}
});
/*
// Spellcheck would be nice but this is a little too eager
// TODO: add back spellcheck? https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/commit/843200836b168332d31e3c991a883d49dbcaf3f8
*/