Skip to content

Commit

Permalink
style: exempt issue_number, pull_number, tag_name and `release_…
Browse files Browse the repository at this point in the history
…id` from camelcase rule
  • Loading branch information
gr2m authored and pvdlg committed May 9, 2019
1 parent b2bc352 commit ba8d0fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 0 additions & 4 deletions lib/add-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const resolveConfig = require('./resolve-config');
const getClient = require('./get-client');
const isPrerelease = require('./is-prerelease');

/* eslint-disable camelcase */

module.exports = async (pluginConfig, context) => {
const {
options: {repositoryUrl},
Expand Down Expand Up @@ -62,5 +60,3 @@ module.exports = async (pluginConfig, context) => {

return {url, name: RELEASE_NAME};
};

/* eslint-enable camelcase */
1 change: 0 additions & 1 deletion lib/fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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
4 changes: 1 addition & 3 deletions lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,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 Down Expand Up @@ -120,7 +119,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
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
},
"xo": {
"prettier": true,
"space": true
"space": true,
"rules": {
"camelcase": ["error", {
"allow": ["issue_number", "pull_number", "tag_name", "release_id"]
}]
}
}
}

0 comments on commit ba8d0fc

Please sign in to comment.