Skip to content

Commit

Permalink
Improve linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rtsao committed Oct 24, 2017
1 parent 3187b62 commit 59f4501
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"env": {
"node": true,
"es6": true
},
"plugins": [
"prettier"
],
Expand Down
2 changes: 2 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* LICENSE file in the root directory of this source tree.
*/

/* eslint-env jest */

const t = require('assert');

test('dummy test', () => {
Expand Down
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,24 @@ module.exports = robot => {
}

const version = await isRelease();

// console.log('dang', version);
if (version) {
const titleVersion = parseTitle(pr.title);
if (!titleVersion || titleVersion.version !== version) {
// console.log('QQQ', titleVersion);
if (!titleVersion || titleVersion.version !== `v${version}`) {
return setStatus(context, {
state: 'failure',
description: 'Detected release PR, but invalid PR title',
});
}
const res = await github.issues.addLabels(
await context.github.issues.addLabels(
context.issue({
labels: ['release'],
}),
);
} else {
try {
const res = await github.issues.deleteLabel(
await context.github.issues.deleteLabel(
context.issue({
name: 'release',
}),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fix": "eslint . --fix"
},
"dependencies": {
"probot": "^0.11.0",
"probot": "^3.0.0",
"semver": "^5.4.1"
},
"devDependencies": {
Expand Down

0 comments on commit 59f4501

Please sign in to comment.