Skip to content

Commit

Permalink
style: exempt "issue_number" and "pull_number" from camelcase rule
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored and pvdlg committed May 8, 2019
1 parent fa677fa commit 6f92175
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/fail.js
Expand Up @@ -30,7 +30,6 @@ module.exports = async (pluginConfig, context) => {

if (srIssue) {
logger.log('Found existing semantic-release issue #%d.', srIssue.number);
// eslint-disable-next-line camelcase
const comment = {owner, repo, issue_number: srIssue.number, body};
debug('create comment: %O', comment);
const {
Expand Down
6 changes: 1 addition & 5 deletions lib/success.js
Expand Up @@ -51,10 +51,9 @@ module.exports = async (pluginConfig, context) => {
const prs = await pFilter(
uniqBy(flatten(await Promise.all(searchQueries)), 'number'),
async ({number}) =>
// eslint-disable-next-line camelcase
(await github.pullRequests.listCommits({owner, repo, pull_number: number})).data.find(({sha}) =>
shas.includes(sha)
) || shas.includes((await github.pullRequests.get({owner, repo, pull_number: number})).data.merge_commit_sha) // eslint-disable-line camelcase
) || shas.includes((await github.pullRequests.get({owner, repo, pull_number: number})).data.merge_commit_sha)
);

debug('found pull requests: %O', prs.map(pr => pr.number));
Expand All @@ -78,11 +77,9 @@ module.exports = async (pluginConfig, context) => {
? template(successComment)({branch, lastRelease, commits, nextRelease, releases, issue})
: getSuccessComment(issue, releaseInfos, nextRelease);
try {
// eslint-disable-next-line camelcase
const state = issue.state || (await github.issues.get({owner, repo, issue_number: issue.number})).data.state;

if (state === 'closed') {
// eslint-disable-next-line camelcase
const comment = {owner, repo, issue_number: issue.number, body};
debug('create comment: %O', comment);
const {
Expand Down Expand Up @@ -128,7 +125,6 @@ module.exports = async (pluginConfig, context) => {
srIssues.map(async issue => {
debug('close issue: %O', issue);
try {
// eslint-disable-next-line camelcase
const updateIssue = {owner, repo, issue_number: issue.number, state: 'closed'};
debug('closing issue: %O', updateIssue);
const {
Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -108,6 +108,11 @@
},
"xo": {
"prettier": true,
"space": true
"space": true,
"rules": {
"camelcase": ["error", {
"allow": ["issue_number", "pull_number"]
}]
}
}
}

0 comments on commit 6f92175

Please sign in to comment.