Skip to content

Commit

Permalink
style: ESLint pass on DM merge request
Browse files Browse the repository at this point in the history
  • Loading branch information
alkihis committed Aug 10, 2021
1 parent 558e526 commit 2ea2f21
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
'member-access': 'off',
'member-ordering': 'off',
'object-literal-sort-keys': 'off',
'no-trailing-spaces': 'error',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
Expand Down
36 changes: 18 additions & 18 deletions src/client/readonly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export default class TwitterApiReadOnly extends TwitterApiBase {

public get v1() {
if (this._v1) return this._v1;

return this._v1 = new TwitterApiv1ReadOnly(this);
}

public get v2() {
if (this._v2) return this._v2;

return this._v2 = new TwitterApiv2ReadOnly(this);
}

Expand All @@ -55,19 +55,19 @@ export default class TwitterApiReadOnly extends TwitterApiBase {
return this.v2.search(what, options);
}


/* Authentification */

/**
* Generate the OAuth request token link for user-based OAuth 1.0 auth.
*
*
* ```ts
* // Instanciate TwitterApi with consumer keys
* const client = new TwitterApi({ appKey: 'consumer_key', appSecret: 'consumer_secret' });
*
*
* const tokenRequest = await client.generateAuthLink('oob-or-your-callback-url');
* // redirect end-user to tokenRequest.url
*
*
* // Save tokenRequest.oauth_token_secret somewhere, it will be needed for next auth step.
* ```
*/
Expand All @@ -85,22 +85,22 @@ export default class TwitterApiReadOnly extends TwitterApiBase {

/**
* Obtain access to user-based OAuth 1.0 auth.
*
*
* After user is redirect from your callback, use obtained oauth_token and oauth_verifier to
* instanciate the new TwitterApi instance.
*
*
* ```ts
* // Use the saved oauth_token_secret associated to oauth_token returned by callback
* const requestClient = new TwitterApi({
* appKey: 'consumer_key',
* appSecret: 'consumer_secret',
* accessToken: 'oauth_token',
* accessSecret: 'oauth_token_secret'
* const requestClient = new TwitterApi({
* appKey: 'consumer_key',
* appSecret: 'consumer_secret',
* accessToken: 'oauth_token',
* accessSecret: 'oauth_token_secret'
* });
*
*
* // Use oauth_verifier obtained from callback request
* const { client: userClient } = await requestClient.login('oauth_verifier');
*
*
* // {userClient} is a valid {TwitterApi} object you can use for future requests
* ```
*/
Expand Down Expand Up @@ -128,13 +128,13 @@ export default class TwitterApiReadOnly extends TwitterApiBase {

/**
* Enable application-only authentification.
*
*
* To make the request, instanciate TwitterApi with consumer and secret.
*
*
* ```ts
* const requestClient = new TwitterApi({ appKey: 'consumer', appSecret: 'secret' });
* const appClient = await requestClient.appLogin();
*
*
* // Use {appClient} to make requests
* ```
*/
Expand Down
4 changes: 2 additions & 2 deletions src/client/readwrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export default class TwitterApiReadWrite extends TwitterApiReadOnly {
/* Direct access to subclients */
public get v1() {
if (this._v1) return this._v1;

return this._v1 = new TwitterApiv1ReadWrite(this);
}

public get v2() {
if (this._v2) return this._v2;

return this._v2 = new TwitterApiv2ReadWrite(this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/paginators/dm.paginator.v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DmEventsV1Paginator extends TwitterPaginator<ReceivedDMEventsV1, Ge
return {
...this._queryParams,
cursor: this._realData.next_cursor,
...(maxResults ? { count: maxResults } : {})
...(maxResults ? { count: maxResults } : {}),
};
}

Expand Down Expand Up @@ -59,7 +59,7 @@ export class WelcomeDmV1Paginator extends TwitterPaginator<WelcomeDirectMessageL
return {
...this._queryParams,
cursor: this._realData.next_cursor,
...(maxResults ? { count: maxResults } : {})
...(maxResults ? { count: maxResults } : {}),
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/v1/client.v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite {
return this.post<WelcomeDmRuleV1Result>('direct_messages/welcome_messages/rules/new.json', {
welcome_message_rule: { welcome_message_id: welcomeMessageId },
}, {
forceBodyMode: 'json', 
forceBodyMode: 'json',
});
}

Expand Down

0 comments on commit 2ea2f21

Please sign in to comment.