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

Commit

Permalink
Merge pull request #213 from netlify/lint/consistent-this
Browse files Browse the repository at this point in the history
Enable `consistent-this` ESLint rule
  • Loading branch information
ehmicky authored Dec 10, 2020
2 parents b250cbd + 05102cb commit 3dc5cf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 3dc5cf6

Please sign in to comment.