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

Enable consistent-this ESLint rule #213

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
// TODO: enable those rules
'array-callback-return': 0,
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