Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting errors in new core pkgs #13643

Merged
1 commit merged into from
Feb 8, 2021
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
6 changes: 3 additions & 3 deletions sdk/core/core-client/src/base64.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ declare global {

/**
* Encodes a string in base64 format.
* @param value the string to encode
* @param value - the string to encode
*/
export function encodeString(value: string): string {
return btoa(value);
}

/**
* Encodes a byte array in base64 format.
* @param value the Uint8Aray to encode
* @param value - the Uint8Aray to encode
*/
export function encodeByteArray(value: Uint8Array): string {
let str = "";
Expand All @@ -30,7 +30,7 @@ export function encodeByteArray(value: Uint8Array): string {

/**
* Decodes a base64 string into a byte array.
* @param value the base64 string to decode
* @param value - the base64 string to decode
*/
export function decodeString(value: string): Uint8Array {
const byteString = atob(value);
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-client/src/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/**
* Encodes a string in base64 format.
* @param value the string to encode
* @param value - the string to encode
* @internal @hidden
*/
export function encodeString(value: string): string {
Expand All @@ -12,7 +12,7 @@ export function encodeString(value: string): string {

/**
* Encodes a byte array in base64 format.
* @param value the Uint8Aray to encode
* @param value - the Uint8Aray to encode
* @internal @hidden
*/
export function encodeByteArray(value: Uint8Array): string {
Expand All @@ -24,7 +24,7 @@ export function encodeByteArray(value: Uint8Array): string {

/**
* Decodes a base64 string into a byte array.
* @param value the base64 string to decode
* @param value - the base64 string to decode
* @internal @hidden
*/
export function decodeString(value: string): Uint8Array {
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-client/src/createSpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ type OperationTracingOptions = OperationOptions["tracingOptions"];
/**
* Creates a function called createSpan to create spans using the global tracer.
* @hidden
* @param spanConfig The name of the operation being performed.
* @param tracingOptions The options for the underlying http request.
* @param spanConfig - The name of the operation being performed.
* @param tracingOptions - The options for the underlying http request.
*/
export function createSpanFunction({ packagePrefix, namespace }: SpanConfig) {
return function<T extends OperationOptions>(
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-client/src/interfaceHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function getStreamingResponseStatusCodes(operationSpec: OperationSpec): S

/**
* Get the path to this parameter's value as a dotted string (a.b.c).
* @param parameter The parameter to get the path string for.
* @param parameter - The parameter to get the path string for.
* @returns The path to this parameter's value as a dotted string.
* @internal @hidden
*/
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-client/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export interface OperationOptions {
*/
export interface OperationRequestOptions {
/**
* @property {object} [customHeaders] User defined custom request headers that
* User defined custom request headers that
* will be applied before the request is sent.
*/
customHeaders?: { [key: string]: string };
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-client/src/operationHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
/**
* @internal @hidden
* Retrieves the value to use for a given operation argument
* @param operationArguments The arguments passed from the generated client
* @param parameter The parameter description
* @param fallbackObject If something isn't found in the arguments bag, look here.
* @param operationArguments - The arguments passed from the generated client
* @param parameter - The parameter description
* @param fallbackObject - If something isn't found in the arguments bag, look here.
* Generally used to look at the service client properties.
*/
export function getOperationArgumentValueFromParameter(
Expand Down
40 changes: 20 additions & 20 deletions sdk/core/core-client/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ class SerializerImpl implements Serializer {
/**
* Serialize the given object based on its metadata defined in the mapper
*
* @param {Mapper} mapper The mapper which defines the metadata of the serializable object
* @param mapper - The mapper which defines the metadata of the serializable object
*
* @param {object|string|Array|number|boolean|Date|stream} object A valid Javascript object to be serialized
* @param object - A valid Javascript object to be serialized
*
* @param {string} objectName Name of the serialized object
* @param objectName - Name of the serialized object
*
* @param {options} options additional options to serialization
* @param options - additional options to serialization
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid serialized Javascript object
* @returns A valid serialized Javascript object
*/
serialize(
mapper: Mapper,
Expand Down Expand Up @@ -206,15 +206,15 @@ class SerializerImpl implements Serializer {
/**
* Deserialize the given object based on its metadata defined in the mapper
*
* @param {object} mapper The mapper which defines the metadata of the serializable object
* @param mapper - The mapper which defines the metadata of the serializable object
*
* @param {object|string|Array|number|boolean|Date|stream} responseBody A valid Javascript entity to be deserialized
* @param responseBody - A valid Javascript entity to be deserialized
*
* @param {string} objectName Name of the deserialized object
* @param objectName - Name of the deserialized object
*
* @param options Controls behavior of XML parser and builder.
* @param options - Controls behavior of XML parser and builder.
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid deserialized Javascript object
* @returns A valid deserialized Javascript object
*/
deserialize(
mapper: Mapper,
Expand Down Expand Up @@ -322,8 +322,8 @@ class SerializerImpl implements Serializer {

/**
* Method that creates and returns a Serializer.
* @param modelMappers Known models to map
* @param isXML If XML should be supported
* @param modelMappers - Known models to map
* @param isXML - If XML should be supported
*/
export function createSerializer(
modelMappers: { [key: string]: any } = {},
Expand Down Expand Up @@ -623,9 +623,9 @@ function serializeDictionaryType(

/**
* Resolves the additionalProperties property from a referenced mapper
* @param serializer the serializer containing the entire set of mappers
* @param mapper the composite mapper to resolve
* @param objectName name of the object being serialized
* @param serializer - the serializer containing the entire set of mappers
* @param mapper - the composite mapper to resolve
* @param objectName - name of the object being serialized
*/
function resolveAdditionalProperties(
serializer: Serializer,
Expand All @@ -644,9 +644,9 @@ function resolveAdditionalProperties(

/**
* Finds the mapper referenced by className
* @param serializer the serializer containing the entire set of mappers
* @param mapper the composite mapper to resolve
* @param objectName name of the object being serialized
* @param serializer - the serializer containing the entire set of mappers
* @param mapper - the composite mapper to resolve
* @param objectName - name of the object being serialized
*/
function resolveReferencedMapper(
serializer: Serializer,
Expand All @@ -669,8 +669,8 @@ function resolveReferencedMapper(

/**
* Resolves a composite mapper's modelProperties.
* @param serializer the serializer containing the entire set of mappers
* @param mapper the composite mapper to resolve
* @param serializer - the serializer containing the entire set of mappers
* @param mapper - the composite mapper to resolve
*/
function resolveModelProperties(
serializer: Serializer,
Expand Down
11 changes: 5 additions & 6 deletions sdk/core/core-client/src/serviceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ export class ServiceClient {

/**
* The ServiceClient constructor
* @constructor
* @param credential The credentials used for authentication with the service.
* @param options The service client options that govern the behavior of the client.
* @param credential - The credentials used for authentication with the service.
* @param options - The service client options that govern the behavior of the client.
*/
constructor(options: ServiceClientOptions = {}) {
this._requestContentType = options.requestContentType;
Expand All @@ -126,8 +125,8 @@ export class ServiceClient {
/**
* Send an HTTP request that is populated using the provided OperationSpec.
* @typeParam T The typed result of the request, based on the OperationSpec.
* @param {OperationArguments} operationArguments The arguments that the HTTP request's templated values will be populated from.
* @param {OperationSpec} operationSpec The OperationSpec to use to populate the httpRequest.
* @param operationArguments - The arguments that the HTTP request's templated values will be populated from.
* @param operationSpec - The OperationSpec to use to populate the httpRequest.
*/
async sendOperationRequest<T>(
operationArguments: OperationArguments,
Expand Down Expand Up @@ -269,7 +268,7 @@ export interface ClientPipelineOptions extends InternalPipelineOptions {
* Creates a new Pipeline for use with a Service Client.
* Adds in deserializationPolicy by default.
* Also adds in bearerTokenAuthenticationPolicy if passed a TokenCredential.
* @param options Options to customize the created pipeline.
* @param options - Options to customize the created pipeline.
*/
export function createClientPipeline(options: ClientPipelineOptions = {}): Pipeline {
const pipeline = createPipelineFromOptions(options ?? {});
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-client/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Returns true if the given value is a basic/primitive type
* (string, number, boolean, null, undefined).
* @param value Value to test
* @param value - Value to test
* @hidden @internal
*/
export function isPrimitiveType(value: any): boolean {
Expand All @@ -15,7 +15,7 @@ const validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?

/**
* Returns true if the given string is in ISO 8601 format.
* @param value The value to be validated for ISO 8601 duration format.
* @param value - The value to be validated for ISO 8601 duration format.
* @hidden @internal
*/
export function isDuration(value: string): boolean {
Expand All @@ -27,7 +27,7 @@ const validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F
/**
* Returns true if the provided uuid is valid.
*
* @param uuid The uuid that needs to be validated.
* @param uuid - The uuid that needs to be validated.
*
* @hidden @internal
*/
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-client/test/serviceClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe("ServiceClient", function() {
};

let request: OperationRequest;
let pipeline = createEmptyPipeline();
const pipeline = createEmptyPipeline();
pipeline.addPolicy(serializationPolicy(), { phase: "Serialize" });
const client = new ServiceClient({
httpsClient: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-https/src/accessTokenCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface AccessTokenCache {
/**
* Sets the cached token.
*
* @param accessToken The AccessToken to be cached or null to
* @param accessToken - The AccessToken to be cached or null to
* clear the cached token.
*/
setCachedToken(accessToken: AccessToken | undefined): void;
Expand Down
12 changes: 6 additions & 6 deletions sdk/core/core-https/src/httpHeaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class HttpHeadersImpl implements HttpHeaders {
/**
* Set a header in this collection with the provided name and value. The name is
* case-insensitive.
* @param name The name of the header to set. This value is case-insensitive.
* @param value The value of the header to set.
* @param name - The name of the header to set. This value is case-insensitive.
* @param value - The value of the header to set.
*/
public set(name: string, value: string | number): void {
this._headersMap.set(normalizeName(name), String(value));
Expand All @@ -32,23 +32,23 @@ class HttpHeadersImpl implements HttpHeaders {
/**
* Get the header value for the provided header name, or undefined if no header exists in this
* collection with the provided name.
* @param name The name of the header. This value is case-insensitive.
* @param name - The name of the header. This value is case-insensitive.
*/
public get(name: string): string | undefined {
return this._headersMap.get(normalizeName(name));
}

/**
* Get whether or not this header collection contains a header entry for the provided header name.
* @param name The name of the header to set. This value is case-insensitive.
* @param name - The name of the header to set. This value is case-insensitive.
*/
public has(name: string): boolean {
return this._headersMap.has(normalizeName(name));
}

/**
* Remove the header with the provided headerName.
* @param name The name of the header to remove.
* @param name - The name of the header to remove.
*/
public delete(name: string): void {
this._headersMap.delete(normalizeName(name));
Expand Down Expand Up @@ -82,7 +82,7 @@ class HttpHeadersImpl implements HttpHeaders {

/**
* Creates an object that satisfies the `HttpHeaders` interface.
* @param rawHeaders A simple object representing initial headers
* @param rawHeaders - A simple object representing initial headers
*/
export function createHttpHeaders(rawHeaders?: RawHttpHeaders): HttpHeaders {
return new HttpHeadersImpl(rawHeaders);
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/core-https/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ export type RawHttpHeaders = { [headerName: string]: string };
export interface HttpHeaders extends Iterable<[string, string]> {
/**
* Returns the value of a specific header or undefined if not set.
* @param name The name of the header to retrieve.
* @param name - The name of the header to retrieve.
*/
get(name: string): string | undefined;
/**
* Returns true if the specified header exists.
* @param name The name of the header to check.
* @param name - The name of the header to check.
*/
has(name: string): boolean;
/**
* Sets a specific header with a given value.
* @param name The name of the header to set.
* @param value The value to use for the header.
* @param name - The name of the header to set.
* @param value - The value to use for the header.
*/
set(name: string, value: string | number): void;
/**
* Removes a specific header from the collection.
* @param name The name of the header to delete.
* @param name - The name of the header to delete.
*/
delete(name: string): void;
/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-https/src/nodeHttpsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class NodeHttpsClient implements HttpsClient {

/**
* Makes a request over an underlying transport layer and returns the response.
* @param request The request to be made.
* @param request - The request to be made.
*/
public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {
const abortController = new AbortController();
Expand Down
16 changes: 8 additions & 8 deletions sdk/core/core-https/src/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export interface PipelinePolicy {
name: string;
/**
* The main method to implement that manipulates a request/response.
* @param request The request being performed.
* @param next The next policy in the pipeline. Must be called to continue the pipeline.
* @param request - The request being performed.
* @param next - The next policy in the pipeline. Must be called to continue the pipeline.
*/
sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse>;
}
Expand All @@ -85,19 +85,19 @@ export interface PipelinePolicy {
export interface Pipeline {
/**
* Add a new policy to the pipeline.
* @param policy A policy that manipulates a request.
* @param options A set of options for when the policy should run.
* @param policy - A policy that manipulates a request.
* @param options - A set of options for when the policy should run.
*/
addPolicy(policy: PipelinePolicy, options?: AddPolicyOptions): void;
/**
* Remove a policy from the pipeline.
* @param options Options that let you specify which policies to remove.
* @param options - Options that let you specify which policies to remove.
*/
removePolicy(options: { name?: string; phase?: PipelinePhase }): PipelinePolicy[];
/**
* Uses the pipeline to make a HTTPS request.
* @param httpsClient The HttpsClient that actually performs the request.
* @param request The request to be made.
* @param httpsClient - The HttpsClient that actually performs the request.
* @param request - The request to be made.
*/
sendRequest(httpsClient: HttpsClient, request: PipelineRequest): Promise<PipelineResponse>;
/**
Expand Down Expand Up @@ -437,7 +437,7 @@ export interface InternalPipelineOptions extends PipelineOptions {

/**
* Create a new pipeline with a default set of customizable policies.
* @param options Options to configure a custom pipeline.
* @param options - Options to configure a custom pipeline.
*/
export function createPipelineFromOptions(options: InternalPipelineOptions): Pipeline {
const pipeline = HttpsPipeline.create();
Expand Down
Loading