Skip to content

Commit

Permalink
Update eslint and related packages
Browse files Browse the repository at this point in the history
    npm i eslint{,-config-wikimedia,-plugin-chai-friendly}@latest
  • Loading branch information
lucaswerkmeister committed Mar 15, 2024
1 parent 7617af4 commit c6d41c0
Show file tree
Hide file tree
Showing 8 changed files with 627 additions and 236 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ but this file may sometimes contain later improvements (e.g. typo fixes).

## next (not yet released)

No changes yet.
- Updated dependencies.

## v0.8.1 (2023-11-12)

Expand Down
10 changes: 5 additions & 5 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
* @property {string} [authorization] Value for the Authorization request header.
* This option can be used to authenticate requests using OAuth 2.0.
* For an owner-only client / consumer, where you have an access token,
* you can set this option to `Bearer ${accessToken}` directly.
* you can set this option to `Bearer ${ accessToken }` directly.
* Otherwise, use the m3api-oauth2 extension package.
* @property {Object.<string, ErrorHandler>} [errorHandlers] Internal option.
* Define handlers for API errors, which can retry the request if appropriate.
Expand Down Expand Up @@ -460,7 +460,7 @@ class Session {
*/
constructor( apiUrl, defaultParams = {}, defaultOptions = {} ) {
if ( !apiUrl.includes( '/' ) ) {
apiUrl = `https://${apiUrl}/w/api.php`;
apiUrl = `https://${ apiUrl }/w/api.php`;
}

/**
Expand Down Expand Up @@ -548,7 +548,7 @@ class Session {
const [ urlParams, bodyParams ] = splitPostParameters( allParams );
result = this.internalPost( this.apiUrl, urlParams, bodyParams, requestHeaders );
} else {
throw new Error( `Unknown request method: ${method}` );
throw new Error( `Unknown request method: ${ method }` );
}
const internalResponse = await result;
const {
Expand All @@ -558,7 +558,7 @@ class Session {
} = internalResponse;

if ( status !== 200 ) {
throw new Error( `API request returned non-200 HTTP status code: ${status}` );
throw new Error( `API request returned non-200 HTTP status code: ${ status }` );
}

if ( 'retry-after' in responseHeaders ) {
Expand Down Expand Up @@ -750,7 +750,7 @@ class Session {
};

if ( userAgent ) {
return `${userAgent} ${DEFAULT_USER_AGENT}`;
return `${ userAgent } ${ DEFAULT_USER_AGENT }`;
} else {
if ( !this.warnedDefaultUserAgent ) {
warn( new DefaultUserAgentWarning() );
Expand Down
Loading

0 comments on commit c6d41c0

Please sign in to comment.