forked from styleguidist/react-styleguidist
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dangerfile.js
17 lines (12 loc) · 851 Bytes
/
dangerfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// eslint-disable-next-line import/no-unresolved, import/extensions
import { danger, warn } from 'danger';
const packageChanged = danger.git.modified_files.includes('package.json');
const lockfileChanged = danger.git.modified_files.includes('package-lock.json');
if (packageChanged && !lockfileChanged) {
warn(`Changes were made to \`package.json\`, but not to \`package-lock.json\`.
If you’ve changed any dependencies (added, removed or updated any packages), please run \`npm install\` and commit changes in package-lock.json file. Make sure you’re using npm 5+.`);
}
if (!packageChanged && lockfileChanged) {
warn(`Changes were made to \`package-lock.json\`, but not to \`package.json\`.
Please remove \`package-lock.json\` changes from your pull request. Try to run \`git checkout master -- package-lock.json\` and commit changes.`);
}