Skip to content

Commit 90f9d8e

Browse files
[app-configuration] Fixing some lint issues (Azure#13055)
- Make eslint run clean for typedoc (still has other warnings/errors that I need to get back to) - Ran eslint auto fix, which got some simple stuff like being able to use 'const' and the copyright header. Fixes Azure#12948
1 parent ab74cfa commit 90f9d8e

18 files changed

+98
-79
lines changed

sdk/appconfiguration/app-configuration/src/appConfigCredential.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { sha256Digest, sha256Hmac } from "./internal/cryptoHelpers";
66

77
/**
88
* @internal
9-
* @ignore
9+
* @hidden
1010
*/
1111
export class AppConfigCredential implements ServiceClientCredentials {
1212
private credential: string;
@@ -20,8 +20,8 @@ export class AppConfigCredential implements ServiceClientCredentials {
2020
/**
2121
* Signs a request with the values provided in the credential and secret parameter.
2222
*
23-
* @param {WebResource} webResource The WebResource to be signed.
24-
* @returns {Promise<WebResource>} The signed request object.
23+
* @param webResource - The WebResource to be signed.
24+
* @returns The signed request object.
2525
*/
2626
async signRequest(webResource: WebResource): Promise<WebResource> {
2727
const verb = webResource.method.toUpperCase();

sdk/appconfiguration/app-configuration/src/appConfigurationClient.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const packageName = "azsdk-js-app-configuration";
6666
* This constant should always be the same as the package.json's version - we use it when forming the
6767
* User - Agent header. There's a unit test that makes sure it always stays in sync.
6868
* @internal
69-
* @ignore
69+
* @hidden
7070
*/
7171
export const packageVersion = "1.1.1";
7272
const apiVersion = "1.0";
@@ -102,7 +102,7 @@ export interface AppConfigurationClientOptions {
102102
/**
103103
* Provides internal configuration options for AppConfigurationClient.
104104
* @internal
105-
* @ignore
105+
* @hidden
106106
*/
107107
export interface InternalAppConfigurationClientOptions extends AppConfigurationClientOptions {
108108
/**
@@ -121,16 +121,16 @@ export class AppConfigurationClient {
121121

122122
/**
123123
* Initializes a new instance of the AppConfigurationClient class.
124-
* @param connectionString Connection string needed for a client to connect to Azure.
125-
* @param options Options for the AppConfigurationClient.
124+
* @param connectionString - Connection string needed for a client to connect to Azure.
125+
* @param options - Options for the AppConfigurationClient.
126126
*/
127127
constructor(connectionString: string, options?: AppConfigurationClientOptions);
128128
/**
129129
* Initializes a new instance of the AppConfigurationClient class using
130130
* a TokenCredential.
131-
* @param endpoint The endpoint of the App Configuration service (ex: https://sample.azconfig.io).
132-
* @param tokenCredential An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the @azure/identity package to create a credential that suits your needs.
133-
* @param options Options for the AppConfigurationClient.
131+
* @param endpoint - The endpoint of the App Configuration service (ex: https://sample.azconfig.io).
132+
* @param tokenCredential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
133+
* @param options - Options for the AppConfigurationClient.
134134
*/
135135
constructor(
136136
endpoint: string,
@@ -184,8 +184,8 @@ export class AppConfigurationClient {
184184
* ```ts
185185
* const result = await client.addConfigurationSetting({ key: "MyKey", label: "MyLabel", value: "MyValue" });
186186
* ```
187-
* @param configurationSetting A configuration setting.
188-
* @param options Optional parameters for the request.
187+
* @param configurationSetting - A configuration setting.
188+
* @param options - Optional parameters for the request.
189189
*/
190190
addConfigurationSetting(
191191
configurationSetting: AddConfigurationSettingParam,
@@ -211,8 +211,8 @@ export class AppConfigurationClient {
211211
* ```ts
212212
* const deletedSetting = await client.deleteConfigurationSetting({ key: "MyKey", label: "MyLabel" });
213213
* ```
214-
* @param id The id of the configuration setting to delete.
215-
* @param options Optional parameters for the request (ex: etag, label)
214+
* @param id - The id of the configuration setting to delete.
215+
* @param options - Optional parameters for the request (ex: etag, label)
216216
*/
217217
deleteConfigurationSetting(
218218
id: ConfigurationSettingId,
@@ -237,8 +237,8 @@ export class AppConfigurationClient {
237237
* ```ts
238238
* const setting = await client.getConfigurationSetting({ key: "MyKey", label: "MyLabel" });
239239
* ```
240-
* @param id The id of the configuration setting to get.
241-
* @param options Optional parameters for the request.
240+
* @param id - The id of the configuration setting to get.
241+
* @param options - Optional parameters for the request.
242242
*/
243243
async getConfigurationSetting(
244244
id: ConfigurationSettingId,
@@ -281,7 +281,7 @@ export class AppConfigurationClient {
281281
* ```ts
282282
* const allSettingsWithLabel = client.listConfigurationSettings({ labels: [ "MyLabel" ] });
283283
* ```
284-
* @param options Optional parameters for the request.
284+
* @param options - Optional parameters for the request.
285285
*/
286286
listConfigurationSettings(
287287
options: ListConfigurationSettingsOptions = {}
@@ -372,7 +372,7 @@ export class AppConfigurationClient {
372372
* ```ts
373373
* const revisionsIterator = client.listRevisions({ keys: ["MyKey"] });
374374
* ```
375-
* @param options Optional parameters for the request.
375+
* @param options - Optional parameters for the request.
376376
*/
377377
listRevisions(
378378
options?: ListRevisionsOptions
@@ -446,9 +446,9 @@ export class AppConfigurationClient {
446446

447447
/**
448448
* Sets the value of a key in the Azure App Configuration service, allowing for an optional etag.
449-
* @param key The name of the key.
450-
* @param configurationSetting A configuration value.
451-
* @param options Optional parameters for the request.
449+
* @param key - The name of the key.
450+
* @param configurationSetting - A configuration value.
451+
* @param options - Optional parameters for the request.
452452
*
453453
* Example code:
454454
* ```ts
@@ -475,7 +475,7 @@ export class AppConfigurationClient {
475475

476476
/**
477477
* Sets or clears a key's read-only status.
478-
* @param id The id of the configuration setting to modify.
478+
* @param id - The id of the configuration setting to modify.
479479
*/
480480
async setReadOnly(
481481
id: ConfigurationSettingId,
@@ -509,7 +509,7 @@ export class AppConfigurationClient {
509509
/**
510510
* Gets the options for the generated AppConfigurationClient
511511
* @internal
512-
* @ignore
512+
* @hidden
513513
*/
514514
export function getGeneratedClientOptions(
515515
baseUri: string,
@@ -545,7 +545,7 @@ export function getGeneratedClientOptions(
545545

546546
/**
547547
* @internal
548-
* @ignore
548+
* @hidden
549549
*/
550550
export function getUserAgentPrefix(userSuppliedUserAgent: string | undefined): string {
551551
const appConfigDefaultUserAgent = `${packageName}/${packageVersion} ${getCoreHttpDefaultUserAgentValue()}`;

sdk/appconfiguration/app-configuration/src/internal/cryptoHelpers.browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/**
77
* @internal
8-
* @ignore
8+
* @hidden
99
*/
1010
export async function sha256Digest(body: string | undefined): Promise<string> {
1111
const digest = await self.crypto.subtle.digest("SHA-256", new TextEncoder().encode(body || ""));
@@ -17,7 +17,7 @@ export async function sha256Digest(body: string | undefined): Promise<string> {
1717

1818
/**
1919
* @internal
20-
* @ignore
20+
* @hidden
2121
*/
2222
export async function sha256Hmac(secret: string, stringToSign: string): Promise<string> {
2323
const key = await self.crypto.subtle.importKey(

sdk/appconfiguration/app-configuration/src/internal/cryptoHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createHash, createHmac } from "crypto";
55

66
/**
77
* @internal
8-
* @ignore
8+
* @hidden
99
*/
1010
export async function sha256Digest(body: string | undefined): Promise<string> {
1111
return createHash("sha256")
@@ -15,7 +15,7 @@ export async function sha256Digest(body: string | undefined): Promise<string> {
1515

1616
/**
1717
* @internal
18-
* @ignore
18+
* @hidden
1919
*/
2020
export async function sha256Hmac(secret: string, stringToSign: string): Promise<string> {
2121
const decodedSecret = Buffer.from(secret, "base64");

sdk/appconfiguration/app-configuration/src/internal/helpers.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { AppConfigurationGetKeyValuesOptionalParams, KeyValue } from "../generat
1717
/**
1818
* Formats the etag so it can be used with a If-Match/If-None-Match header
1919
* @internal
20-
* @ignore
20+
* @hidden
2121
*/
2222
export function quoteETag(etag: string | undefined): string | undefined {
2323
// https://tools.ietf.org/html/rfc7232#section-3.1
@@ -39,9 +39,9 @@ export function quoteETag(etag: string | undefined): string | undefined {
3939
/**
4040
* Checks the onlyIfChanged/onlyIfUnchanged properties to make sure we haven't specified both
4141
* and throws an Error. Otherwise, returns the properties properly quoted.
42-
* @param options An options object with onlyIfChanged/onlyIfUnchanged fields
42+
* @param options - An options object with onlyIfChanged/onlyIfUnchanged fields
4343
* @internal
44-
* @ignore
44+
* @hidden
4545
*/
4646
export function checkAndFormatIfAndIfNoneMatch(
4747
configurationSetting: ConfigurationSettingId,
@@ -73,7 +73,7 @@ export function checkAndFormatIfAndIfNoneMatch(
7373
* into the format the REST call will need.
7474
*
7575
* @internal
76-
* @ignore
76+
* @hidden
7777
*/
7878
export function formatWildcards(
7979
listConfigOptions: ListConfigurationSettingsOptions | ListRevisionsOptions
@@ -106,9 +106,9 @@ export function formatWildcards(
106106

107107
/**
108108
* Handles translating a Date acceptDateTime into a string as needed by the API
109-
* @param newOptions A newer style options with acceptDateTime as a date (and with proper casing!)
109+
* @param newOptions - A newer style options with acceptDateTime as a date (and with proper casing!)
110110
* @internal
111-
* @ignore
111+
* @hidden
112112
*/
113113
export function formatAcceptDateTime(newOptions: {
114114
acceptDateTime?: Date;
@@ -122,11 +122,11 @@ export function formatAcceptDateTime(newOptions: {
122122
* Take the URL that gets returned from next link and extract the 'after' token needed
123123
* to get the next page of results.
124124
* @internal
125-
* @ignore
125+
* @hidden
126126
*/
127127
export function extractAfterTokenFromNextLink(nextLink: string) {
128-
let parsedLink = URLBuilder.parse(nextLink);
129-
let afterToken = parsedLink.getQueryParameterValue("after");
128+
const parsedLink = URLBuilder.parse(nextLink);
129+
const afterToken = parsedLink.getQueryParameterValue("after");
130130

131131
if (afterToken == null || Array.isArray(afterToken)) {
132132
throw new Error("Invalid nextLink - invalid after token");
@@ -140,7 +140,7 @@ export function extractAfterTokenFromNextLink(nextLink: string) {
140140
* to prevent possible errors by the user in accessing a model that is uninitialized. This can happen
141141
* in cases like HTTP status code 204 or 304, which return an empty response body.
142142
*
143-
* @param configurationSetting The configuration setting to alter
143+
* @param configurationSetting - The configuration setting to alter
144144
*/
145145
export function makeConfigurationSettingEmpty(
146146
configurationSetting: Partial<Record<Exclude<keyof ConfigurationSetting, "key">, any>>
@@ -161,8 +161,8 @@ export function makeConfigurationSettingEmpty(
161161
}
162162

163163
/**
164-
* @ignore
165164
* @internal
165+
* @hidden
166166
*/
167167
export function transformKeyValue(kvp: KeyValue): ConfigurationSetting {
168168
const obj: ConfigurationSetting & KeyValue = {
@@ -175,8 +175,8 @@ export function transformKeyValue(kvp: KeyValue): ConfigurationSetting {
175175
}
176176

177177
/**
178-
* @ignore
179178
* @internal
179+
* @hidden
180180
*/
181181
export function transformKeyValueResponseWithStatusCode<
182182
T extends KeyValue & HttpResponseField<any>
@@ -190,8 +190,8 @@ export function transformKeyValueResponseWithStatusCode<
190190
}
191191

192192
/**
193-
* @ignore
194193
* @internal
194+
* @hidden
195195
*/
196196
export function transformKeyValueResponse<
197197
T extends KeyValue & { eTag?: string } & HttpResponseField<any>

sdk/appconfiguration/app-configuration/src/internal/synctokenpolicy.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Microsoft Corporation.
2-
// Licensed under the MIT License.
2+
// Licensed under the MIT license.
33

44
import {
55
RequestPolicy,
@@ -14,15 +14,15 @@ import {
1414
* The sync token header, as described here:
1515
* https://github.com/Azure/AppConfiguration/blob/master/docs/REST/consistency.md
1616
* @internal
17-
* @ignore
17+
* @hidden
1818
*/
1919
export const SyncTokenHeaderName = "sync-token";
2020

2121
/**
2222
* A policy factory for injecting sync tokens properly into outgoing requests.
23-
* @param syncTokens
23+
* @param syncTokens - the sync tokens store to be used across requests.
2424
* @internal
25-
* @ignore
25+
* @hidden
2626
*/
2727
export function syncTokenPolicy(syncTokens: SyncTokens): RequestPolicyFactory {
2828
return {
@@ -62,7 +62,7 @@ class SyncTokenPolicy extends BaseRequestPolicy {
6262
* https://github.com/Azure/AppConfiguration/blob/master/docs/REST/consistency.md
6363
*
6464
* @internal
65-
* @ignore
65+
* @hidden
6666
*/
6767
export class SyncTokens {
6868
private _currentSyncTokens = new Map<string, SyncToken>();
@@ -76,7 +76,7 @@ export class SyncTokens {
7676
* If given an empty value (or undefined) it clears the current list of sync tokens.
7777
* (indicates the service has properly absorbed values into the cluster).
7878
*
79-
* @param syncTokenHeaderValue The full value of the sync token header.
79+
* @param syncTokenHeaderValue - The full value of the sync token header.
8080
*/
8181
addSyncTokenFromHeaderValue(syncTokenHeaderValue: string | undefined) {
8282
if (syncTokenHeaderValue == null || syncTokenHeaderValue === "") {
@@ -137,10 +137,10 @@ interface SyncToken {
137137
/**
138138
* Parses a single sync token into it's constituent parts.
139139
*
140-
* @param syncToken A single sync token.
140+
* @param syncToken - A single sync token.
141141
*
142142
* @internal
143-
* @ignore
143+
* @hidden
144144
*/
145145
export function parseSyncToken(syncToken: string): SyncToken {
146146
const matches = syncToken.match(syncTokenRegex);

sdk/appconfiguration/app-configuration/src/internal/tracingHelpers.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Microsoft Corporation.
2-
// Licensed under the MIT License.
2+
// Licensed under the MIT license.
33

44
import { getTracer } from "@azure/core-tracing";
55
import { Span, SpanKind, CanonicalCode } from "@opentelemetry/api";
@@ -9,26 +9,26 @@ import { RestError } from "@azure/core-http";
99

1010
/**
1111
* @internal
12-
* @ignore
12+
* @hidden
1313
*/
1414
export interface Spannable {
1515
spanOptions?: SpanOptions;
1616
}
1717

1818
/**
1919
* @internal
20-
* @ignore
20+
* @hidden
2121
*/
2222
export class Spanner<TClient> {
2323
constructor(private baseOperationName: string) {}
2424

2525
/**
2626
* Traces an operation and properly handles reporting start, end and errors for a given span
2727
*
28-
* @param operationName Name of a method in the TClient type
29-
* @param options An options class, typically derived from @azure/core-http/RequestOptionsBase
30-
* @param fn The function to call with an options class that properly propagates the span context
31-
* @param translateToCanonicalCodeFn An optional function to translate thrown errors into a CanonicalCode for the span
28+
* @param operationName - Name of a method in the TClient type
29+
* @param options - An options class, typically derived from \@azure/core-http/RequestOptionsBase
30+
* @param fn - The function to call with an options class that properly propagates the span context
31+
* @param translateToCanonicalCodeFn - An optional function to translate thrown errors into a CanonicalCode for the span
3232
*/
3333
async trace<OptionsT extends Spannable, ReturnT>(
3434
operationName: keyof TClient,

sdk/appconfiguration/app-configuration/src/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export interface ListSettingsOptions extends OptionalFields {
244244
* | abc* | Matches key names that start with abc |
245245
*
246246
* These characters are reserved and must be prefixed with backslash in order
247-
* to be specified: * or \ or ,
247+
* to be specified: * or \\ or ,
248248
*/
249249
keyFilter?: string;
250250

@@ -262,7 +262,7 @@ export interface ListSettingsOptions extends OptionalFields {
262262
* | prod* | Matches key with label names that start with prod |
263263
*
264264
* These characters are reserved and must be prefixed with backslash in order
265-
* to be specified: * or \ or ,
265+
* to be specified: * or \\ or ,
266266
*/
267267
labelFilter?: string;
268268
}

0 commit comments

Comments
 (0)