Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ before_script:
- tsc
script:
- 'npm run test:ci'
- yarn danger
after_success:
- './node_modules/.bin/jest --coverage && cat ./coverage/lcov.info | ./node_modules/.bin/codecov'
notifications:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
"newclear",
"shipit",
"snapupdate",
"tada",
"tempy",
"updtr"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": []
}
}
23 changes: 23 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { message, danger, warn, schedule } from 'danger'
// can't use import in JS
const spellcheck = require('danger-plugin-spellcheck').default

// warn('Big ol mean warning')
// let's spellcheck
schedule(spellcheck())

// Enforce yarn.lock updates
const packageChanged = danger.git.modified_files.includes('package.json')
const yarnLockfileChanged = danger.git.modified_files.includes('yarn.lock')
const npmLockfileChanged = danger.git.modified_files.includes('package-lock.json')
if (packageChanged && !yarnLockfileChanged) {
const message = 'Changes were made to package.json, but not to yarn.lock'
const idea = 'Perhaps you need to run `yarn install`?'
warn(`${message} - <i>${idea}</i>`)
}
// Enforce package-lock.json
if (packageChanged && !npmLockfileChanged) {
const message = 'Changes were made to package.json, but not to package-lock.json'
const idea = 'Perhaps you need to run `npm install`?'
warn(`${message} - <i>${idea}</i>`)
}
Loading