diff --git a/bin/contributors.js b/bin/contributors.js index 03f3217f..12dc2499 100644 --- a/bin/contributors.js +++ b/bin/contributors.js @@ -194,7 +194,7 @@ const renderPRsList = async (tag, template, {comments_threshold= 5, awesome_thre for(const merge of release.merges) { const pr = await getIssueById(merge.id); - if (pr && pr.labels.find(({name})=> name === label)) { + if (pr && pr.labels.find(({name}) => name === label)) { const {reactions, body} = pr; prs[pr.number] = pr; pr.isHot = pr.comments > comments_threshold; diff --git a/bin/helpers/colorize.js b/bin/helpers/colorize.js index 8fdd087e..3e02bdb5 100644 --- a/bin/helpers/colorize.js +++ b/bin/helpers/colorize.js @@ -1,6 +1,6 @@ import chalk from 'chalk'; -export const colorize = (...colors)=> { +export const colorize = (...colors) => { if(!colors.length) { colors = ['green', 'cyan', 'magenta', 'blue', 'yellow', 'red']; } diff --git a/bin/pr.js b/bin/pr.js index 2d612e98..6fc9bae6 100644 --- a/bin/pr.js +++ b/bin/pr.js @@ -120,8 +120,8 @@ const generateFileReport = async (files, historyCount = 3) => { const generateBody = async ({files, template = './templates/pr.hbs'} = {}) => { const data = await generateFileReport(files); - Handlebars.registerHelper('filesize', (bytes)=> bytes != null ? prettyBytes(bytes) : ''); - Handlebars.registerHelper('percent', (value)=> Number.isFinite(value) ? `${(value * 100).toFixed(1)}%` : `---` ); + Handlebars.registerHelper('filesize', (bytes) => bytes != null ? prettyBytes(bytes) : ''); + Handlebars.registerHelper('percent', (value) => Number.isFinite(value) ? `${(value * 100).toFixed(1)}%` : `---` ); return Handlebars.compile(String(await fs.readFile(template)))(data); } diff --git a/gulpfile.js b/gulpfile.js index 2e185819..8c215a45 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -40,7 +40,7 @@ async function getContributors(user, repo, maxCount = 1) { { params: { per_page: maxCount } } )).data; - return Promise.all(contributors.map(async (contributor)=> { + return Promise.all(contributors.map(async (contributor) => { return {...contributor, ...(await axios.get( `https://api.github.com/users/${encodeURIComponent(contributor.login)}` )).data}; diff --git a/test/module/test.js b/test/module/test.js index 738072d5..ca6e1f8b 100644 --- a/test/module/test.js +++ b/test/module/test.js @@ -44,7 +44,7 @@ const remove = async (file) => { describe('module', function () { - before(async ()=> { + before(async () => { console.log('✓ Creating build backup...'); await fs.copy('./dist/', BACKUP_PATH); console.log('✓ Exec build script...'); @@ -149,10 +149,10 @@ describe('module', function () { }); describe('typings', () => { - describe('ESM', ()=> { + describe('ESM', () => { const pkgPath = path.join(__dirname, './typings/esm'); - after(async ()=> { + after(async () => { await remove(path.join(pkgPath, './node_modules')); }); @@ -166,10 +166,10 @@ describe('module', function () { }); }); - describe('CommonJS', ()=> { + describe('CommonJS', () => { const pkgPath = path.join(__dirname, './typings/cjs'); - after(async ()=> { + after(async () => { await remove(path.join(pkgPath, './node_modules')); }); diff --git a/test/specs/core/mergeConfig.spec.js b/test/specs/core/mergeConfig.spec.js index 2669b509..465b6a0d 100644 --- a/test/specs/core/mergeConfig.spec.js +++ b/test/specs/core/mergeConfig.spec.js @@ -101,7 +101,7 @@ describe('core::mergeConfig', function() { expect(merged.nestedConfig.propertyOnRequestConfig).toEqual(true); }); - describe('headers', ()=> { + describe('headers', () => { it('should allow merging with AxiosHeaders instances', () => { const merged = mergeConfig({ headers: new AxiosHeaders({ diff --git a/test/specs/headers.spec.js b/test/specs/headers.spec.js index 47bc57b3..d55c06d7 100644 --- a/test/specs/headers.spec.js +++ b/test/specs/headers.spec.js @@ -133,7 +133,7 @@ describe('headers', function () { }); }); - it('should allow an AxiosHeaders instance to be used as the value of the headers option', async ()=> { + it('should allow an AxiosHeaders instance to be used as the value of the headers option', async () => { const instance = axios.create({ headers: new AxiosHeaders({ xFoo: 'foo', diff --git a/test/specs/utils/merge.spec.js b/test/specs/utils/merge.spec.js index 75c6312d..83a8a0c2 100644 --- a/test/specs/utils/merge.spec.js +++ b/test/specs/utils/merge.spec.js @@ -84,7 +84,7 @@ describe('utils::merge', function () { expect(d.a).not.toBe(a); }); - it('should support caseless option', ()=> { + it('should support caseless option', () => { const a = {x: 1}; const b = {X: 2}; const merged = merge.call({caseless: true}, a, b); diff --git a/test/unit/adapters/adapters.js b/test/unit/adapters/adapters.js index f0d01393..a6651367 100644 --- a/test/unit/adapters/adapters.js +++ b/test/unit/adapters/adapters.js @@ -26,12 +26,12 @@ describe('adapters', function () { it('should detect adapter unavailable status', function () { adapters.adapters['testadapter'] = null; - assert.throws(()=> adapters.getAdapter('testAdapter'), /is not available in the build/) + assert.throws(() => adapters.getAdapter('testAdapter'), /is not available in the build/) }); it('should detect adapter unsupported status', function () { adapters.adapters['testadapter'] = false; - assert.throws(()=> adapters.getAdapter('testAdapter'), /is not supported by the environment/) + assert.throws(() => adapters.getAdapter('testAdapter'), /is not supported by the environment/) }); it('should pick suitable adapter from the list', function () { diff --git a/test/unit/adapters/http.js b/test/unit/adapters/http.js index 3e087a25..fc233c83 100644 --- a/test/unit/adapters/http.js +++ b/test/unit/adapters/http.js @@ -66,7 +66,7 @@ function toleranceRange(positive, negative) { const nodeVersion = process.versions.node.split('.').map(v => parseInt(v, 10)); const nodeMajorVersion = nodeVersion[0]; -var noop = ()=> {}; +var noop = () => {}; describe('supports http with nodejs', function () { afterEach(async function () { @@ -541,7 +541,7 @@ describe('supports http with nodejs', function () { }); }); - describe('algorithms', ()=> { + describe('algorithms', () => { const responseBody ='str'; for (const [typeName, zipped] of Object.entries({ @@ -783,7 +783,7 @@ describe('supports http with nodejs', function () { // consume the req stream req.on('data', noop); // and wait for the end before responding, otherwise an ECONNRESET error will be thrown - req.on('end', ()=> { + req.on('end', () => { res.end('OK'); }); }).listen(4444, function (err) { @@ -1844,7 +1844,7 @@ describe('supports http with nodejs', function () { const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64'); - axios.get(dataURI).then(({data})=> { + axios.get(dataURI).then(({data}) => { assert.deepStrictEqual(data, buffer); done(); }).catch(done); @@ -1861,7 +1861,7 @@ describe('supports http with nodejs', function () { const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64'); - axios.get(dataURI, {responseType: 'blob'}).then(async ({data})=> { + axios.get(dataURI, {responseType: 'blob'}).then(async ({data}) => { assert.strictEqual(data.type, 'application/octet-stream'); assert.deepStrictEqual(await data.text(), '123'); done(); @@ -1873,7 +1873,7 @@ describe('supports http with nodejs', function () { const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64'); - axios.get(dataURI, {responseType: "text"}).then(({data})=> { + axios.get(dataURI, {responseType: "text"}).then(({data}) => { assert.deepStrictEqual(data, '123'); done(); }).catch(done); @@ -1884,7 +1884,7 @@ describe('supports http with nodejs', function () { const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64'); - axios.get(dataURI, {responseType: "stream"}).then(({data})=> { + axios.get(dataURI, {responseType: "stream"}).then(({data}) => { var str = ''; data.on('data', function(response){ @@ -2049,7 +2049,7 @@ describe('supports http with nodejs', function () { maxRedirects: 0 }); - samples.slice(skip).forEach(({rate, progress}, i, _samples)=> { + samples.slice(skip).forEach(({rate, progress}, i, _samples) => { assert.ok(compareValues(rate, configRate), `Rate sample at index ${i} is out of the expected range (${rate} / ${configRate}) [${ _samples.map(({rate}) => rate).join(', ') @@ -2097,7 +2097,7 @@ describe('supports http with nodejs', function () { maxRedirects: 0 }); - samples.slice(skip).forEach(({rate, progress}, i, _samples)=> { + samples.slice(skip).forEach(({rate, progress}, i, _samples) => { assert.ok(compareValues(rate, configRate), `Rate sample at index ${i} is out of the expected range (${rate} / ${configRate}) [${ _samples.map(({rate}) => rate).join(', ') diff --git a/test/unit/core/AxiosHeaders.js b/test/unit/core/AxiosHeaders.js index 2551fd63..46198749 100644 --- a/test/unit/core/AxiosHeaders.js +++ b/test/unit/core/AxiosHeaders.js @@ -168,12 +168,12 @@ describe('AxiosHeaders', function () { headers.set('foo', 'bar=value1'); - assert.strictEqual(headers.has('foo', (value, header, headers)=> { + assert.strictEqual(headers.has('foo', (value, header, headers) => { assert.strictEqual(value, 'bar=value1'); assert.strictEqual(header, 'foo'); return true; }), true); - assert.strictEqual(headers.has('foo', ()=> false), false); + assert.strictEqual(headers.has('foo', () => false), false); }); it('should support string pattern', function () { @@ -246,7 +246,7 @@ describe('AxiosHeaders', function () { headers.set('foo', 'bar=value1'); - headers.delete('foo', (value, header)=> { + headers.delete('foo', (value, header) => { assert.strictEqual(value, 'bar=value1'); assert.strictEqual(header, 'foo'); return false; @@ -254,7 +254,7 @@ describe('AxiosHeaders', function () { assert.strictEqual(headers.has('foo'), true); - assert.strictEqual(headers.delete('foo', ()=> true), true); + assert.strictEqual(headers.delete('foo', () => true), true); assert.strictEqual(headers.has('foo'), false); }); @@ -277,7 +277,7 @@ describe('AxiosHeaders', function () { }); }); - describe('clear', ()=> { + describe('clear', () => { it('should clear all headers', () => { const headers = new AxiosHeaders({x: 1, y:2});