diff --git a/.eslintrc.js b/.eslintrc.js index 71218bb..bb30819 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,7 +5,6 @@ module.exports = { rules: { // TODO: enable those rules complexity: 0, - 'consistent-this': 0, 'id-length': 0, 'line-comment-position': 0, 'max-nested-callbacks': 0, diff --git a/src/index.js b/src/index.js index 5ea3dde..daf0aa8 100644 --- a/src/index.js +++ b/src/index.js @@ -59,13 +59,11 @@ class NetlifyAPI { async getAccessToken(ticket, opts) { opts = { poll: 1000, timeout: 3.6e6, ...opts } - const api = this - const { id } = ticket let authorizedTicket // ticket capture const checkTicket = async () => { - const t = await api.showTicket({ ticketId: id }) + const t = await this.showTicket({ ticketId: id }) if (t.authorized) { authorizedTicket = t } @@ -78,7 +76,7 @@ class NetlifyAPI { message: 'Timeout while waiting for ticket grant', }) - const accessTokenResponse = await api.exchangeTicket({ ticketId: authorizedTicket.id }) + const accessTokenResponse = await this.exchangeTicket({ ticketId: authorizedTicket.id }) // See https://open-api.netlify.com/#/default/exchangeTicket for shape this.accessToken = accessTokenResponse.access_token return accessTokenResponse.access_token