Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
feat(eslint): sort object keys
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Nov 21, 2018
1 parent 403d629 commit f263092
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 40 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
'prefer-const': 2,
'arrow-body-style': [2, 'as-needed'],
curly: [2, 'multi'],
'sort-keys': 2,

// unicorn
'unicorn/no-fn-reference-in-iterator': 0, // Allows [].map(func)
Expand Down
2 changes: 1 addition & 1 deletion resolve-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ const { resolve, join } = require('path')
const resolveInDir = filePath => resolve(__dirname, filePath)
const resolveBin = filePath =>
resolveInDir(join('./node_modules/.bin', filePath))
module.exports = { resolveInDir, resolveBin }
module.exports = { resolveBin, resolveInDir }
78 changes: 39 additions & 39 deletions src/scripts/set-github-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const fetch = require('isomorphic-fetch')
// Helper
const githubAPICaller = (path, { method = 'GET', body } = {}) =>
fetch(`https://api.github.com${encodeURI(path)}`, {
method,
body: body && JSON.stringify(body),
headers: {
Authorization: `token ${process.env.GITHUB_PERSONAL_ACCESS_TOKEN}`
},
body: body && JSON.stringify(body)
method
}).then(res => (method === 'DELETE' ? res : res.json()))

// Run
Expand All @@ -28,95 +28,95 @@ const run = async () => {
// Set new labels for repo
for (const newLabel of [
{
name: 'duplicate :two:',
color: 'ededed',
description: 'Is a duplicate.'
description: 'Is a duplicate.',
name: 'duplicate :two:'
},
{
name: 'starter :baby_bottle:',
color: 'ffc0cb',
description: 'Good for new contributors.'
description: 'Good for new contributors.',
name: 'starter :baby_bottle:'
},
{
name: 'Priority: Critical :fire:',
color: 'ee0701',
description: 'Mission critical.'
description: 'Mission critical.',
name: 'Priority: Critical :fire:'
},
{
name: 'Priority: High',
color: 'd93f0b',
description: 'Top of to-do list.'
description: 'Top of to-do list.',
name: 'Priority: High'
},
{
name: 'Priority: Low',
color: '0e8a16',
description: 'Bottom of to-do list.'
description: 'Bottom of to-do list.',
name: 'Priority: Low'
},
{
name: 'Priority: Medium',
color: 'fbca04',
description: 'Somewhere in the middle of to-do list.'
description: 'Somewhere in the middle of to-do list.',
name: 'Priority: Medium'
},
{
name: 'Status: Abandoned',
color: '000000',
description: 'The assigned contributor gave up.'
description: 'The assigned contributor gave up.',
name: 'Status: Abandoned'
},
{
name: 'Status: Available',
color: 'c2e0c6',
description: 'Open for anyone to work on.'
description: 'Open for anyone to work on.',
name: 'Status: Available'
},
{
name: 'Status: Blocked',
color: 'ee0701',
description: 'Blocked by another issue.'
description: 'Blocked by another issue.',
name: 'Status: Blocked'
},
{
name: 'Status: In Progress',
color: 'cccccc',
description: 'Someone is already working on it.'
description: 'Someone is already working on it.',
name: 'Status: In Progress'
},
{
name: 'Status: On Hold',
color: 'e99695',
description: 'Purposely paused.'
description: 'Purposely paused.',
name: 'Status: On Hold'
},
{
name: 'Status: Proposal',
color: 'd4c5f9',
description: "Don't work on it until accepted."
description: "Don't work on it until accepted.",
name: 'Status: Proposal'
},
{
name: 'Status: Review Needed',
color: 'fbca04',
description: 'Pending reviews.'
description: 'Pending reviews.',
name: 'Status: Review Needed'
},
{ name: 'Type: Bug :bug:', color: 'ee0701', description: 'Bugs.' },
{ color: 'ee0701', description: 'Bugs.', name: 'Type: Bug :bug:' },
{
name: 'Type: Documentation :books:',
color: '5319e7',
description: 'Documentation work.'
description: 'Documentation work.',
name: 'Type: Documentation :books:'
},
{
name: 'Type: Enhancement :sparkles:',
color: '1d76db',
description: 'Enhancements.'
description: 'Enhancements.',
name: 'Type: Enhancement :sparkles:'
},
{
name: 'Type: Maintenance :construction:',
color: 'fbca04',
description: 'Chores.'
description: 'Chores.',
name: 'Type: Maintenance :construction:'
},
{
name: 'Type: Question :grey_question:',
color: 'cc317c',
description: 'Queries about the project.'
description: 'Queries about the project.',
name: 'Type: Question :grey_question:'
}
])
await githubAPICaller(`/repos/kleros/${repo}/labels`, {
method: 'POST',
body: newLabel
body: newLabel,
method: 'POST'
})

console.log(`Finished setting labels for ${repo}.`)
Expand Down

0 comments on commit f263092

Please sign in to comment.