From 169285225f6dcbb24dbe5c50e7ca926fbb4a4269 Mon Sep 17 00:00:00 2001 From: Kevin Wilde Date: Thu, 31 Mar 2022 12:02:23 -0700 Subject: [PATCH] Fix prettier (#307) # Summary It appears the glob for prettier was never updated after this repo was converted to TypeScript. # Testing `npm run format` now formats ts and js files --- package.json | 2 +- src/base.ts | 6 +----- src/deprecate.ts | 6 +++++- src/fetch.ts | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index a1b3046f..deb7666e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "pretest": "npm run lint && npm run prepare && cp build/airtable.browser.js test/test_files; true", "lint": "eslint '*/**/*.{js,ts,tsx}'", - "format": "prettier --write '**/*.js'", + "format": "prettier --write '**/*.[j|t]s'", "test": "jest --env node --coverage --no-cache", "test-unit": "jest --env node", "prepare": "rm -rf lib/* && rm -f build/airtable.browser.js && tsc && cp lib/airtable.js lib/tmp_airtable.js && grunt browserify && rm lib/tmp_airtable.js" diff --git a/src/base.ts b/src/base.ts index 14e45c89..4d0730b8 100644 --- a/src/base.ts +++ b/src/base.ts @@ -57,11 +57,7 @@ class Base { const controller = new AbortController(); const headers = this._getRequestHeaders( - Object.assign( - {}, - this._airtable._customHeaders, - options.headers ?? {} - ) + Object.assign({}, this._airtable._customHeaders, options.headers ?? {}) ); const requestOptions: RequestInit = { diff --git a/src/deprecate.ts b/src/deprecate.ts index b0d78ff0..8c2b8dba 100644 --- a/src/deprecate.ts +++ b/src/deprecate.ts @@ -11,7 +11,11 @@ const didWarnForDeprecation = {}; * * @return a wrapped function */ -function deprecate(fn: (...args: Args) => void, key: string, message: string): (...args: Args) => void { +function deprecate( + fn: (...args: Args) => void, + key: string, + message: string +): (...args: Args) => void { return function(...args: Args): void { if (!didWarnForDeprecation[key]) { didWarnForDeprecation[key] = true; diff --git a/src/fetch.ts b/src/fetch.ts index 4e61aa9d..d1cc2736 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -1,5 +1,4 @@ // istanbul ignore file import nodeFetch from 'node-fetch'; -export = -typeof window === 'undefined' ? (nodeFetch as typeof fetch) : window.fetch.bind(window); +export = typeof window === 'undefined' ? (nodeFetch as typeof fetch) : window.fetch.bind(window);