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: ESLint issues in botframework-schema #4836

Merged
merged 2 commits into from
Jan 6, 2025
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
10 changes: 0 additions & 10 deletions libraries/botframework-schema/eslint.config.cjs

This file was deleted.

5 changes: 2 additions & 3 deletions libraries/botframework-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@
"dependencies": {
"uuid": "^10.0.0",
"zod": "^3.23.8",
"adaptivecards": "1.2.3",
"eslint-plugin-only-warn": "^1.1.0"
"adaptivecards": "1.2.3"
},
"scripts": {
"build": "tsc -b",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"test": "yarn build && nyc mocha tests/",
"test:compat": "api-extractor run --verbose"
},
Expand Down
8 changes: 4 additions & 4 deletions libraries/botframework-schema/src/activityEx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export namespace ActivityEx {
name: string,
valueType?: string,
value?: unknown,
label?: string
label?: string,
): Partial<ITraceActivity> {
return {
type: ActivityTypes.Trace,
Expand Down Expand Up @@ -188,7 +188,7 @@ export namespace ActivityEx {
name: string,
value?: unknown,
valueType?: string,
label?: string
label?: string,
): ITraceActivity {
return {
type: ActivityTypes.Trace,
Expand Down Expand Up @@ -229,7 +229,7 @@ export namespace ActivityEx {
* @returns This activity as a contact relation update activity; or null.
*/
export function asContactRelationUpdateActivity(
source: Partial<Activity>
source: Partial<Activity>,
): Partial<IContactRelationUpdateActivity> {
return isActivity(source, ActivityTypes.ContactRelationUpdate) ? source : null;
}
Expand Down Expand Up @@ -371,7 +371,7 @@ export namespace ActivityEx {
* @returns This activity as a command result activity; or null.
*/
export function asCommandResultActivity<T = unknown>(
source: Partial<Activity>
source: Partial<Activity>,
): Partial<ICommandResultActivity<T>> {
return isActivity(source, ActivityTypes.CommandResult) ? source : null;
}
Expand Down
10 changes: 5 additions & 5 deletions libraries/botframework-schema/src/activityInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export interface IActivity {
/**
* Contains channel-specific content.
*/
channelData?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
channelData?: any;
}

export interface IConversationUpdateActivity extends IActivity {
Expand Down Expand Up @@ -196,7 +196,7 @@ export interface IMessageActivity extends IActivity {
/**
* A value that is associated with the activity.
*/
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value?: any;
}

export interface IMessageUpdateActivity extends IMessageActivity, IActivity {}
Expand Down Expand Up @@ -247,7 +247,7 @@ export interface IEventActivity extends IActivity {
/**
* A value that is associated with the activity.
*/
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value?: any;

/**
* A reference to another conversation or activity.
Expand All @@ -264,7 +264,7 @@ export interface IInvokeActivity extends IActivity {
/**
* A value that is associated with the activity.
*/
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value?: any;

/**
* A reference to another conversation or activity.
Expand All @@ -291,7 +291,7 @@ export interface ITraceActivity extends IActivity {
/**
* A value that is associated with the activity.
*/
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value?: any;

/**
* A reference to another conversation or activity.
Expand Down
54 changes: 27 additions & 27 deletions libraries/botframework-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface InnerHttpError {
/**
* Body from failed request
*/
body: any; // eslint-disable-line @typescript-eslint/no-explicit-any
body: any;
}

/**
Expand Down Expand Up @@ -159,7 +159,7 @@ export interface ChannelAccount {
/**
* Custom properties object (optional)
*/
properties?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
properties?: any;
}

const channelAccount = z.object({
Expand Down Expand Up @@ -221,7 +221,7 @@ export interface ConversationAccount {
/**
* Custom properties object (optional)
*/
properties?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
properties?: any;
}

const conversationAccount = z.object({
Expand Down Expand Up @@ -306,11 +306,11 @@ export interface CardAction {
/**
* Supplementary parameter for action. Content of this property depends on the ActionType
*/
value: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value: any;
/**
* Channel-specific data associated with this action
*/
channelData?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
channelData?: any;
/**
* Alternate image text to be used in place of the `image` field
*/
Expand Down Expand Up @@ -391,7 +391,7 @@ export interface Attachment {
/**
* Embedded content
*/
content?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
content?: any;
/**
* (OPTIONAL) The name of the attachment
*/
Expand Down Expand Up @@ -435,7 +435,7 @@ export interface Entity {
/**
* Additional properties.
*/
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
[key: string]: any;
}

const entity = z.record(z.unknown()).refine((val) => typeof val.type === 'string');
Expand Down Expand Up @@ -702,7 +702,7 @@ export interface Activity {
/**
* Contains channel-specific content.
*/
channelData?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
channelData?: any;
/**
* Indicates whether the recipient of a contactRelationUpdate was added or removed from the
* sender's contact list.
Expand All @@ -723,7 +723,7 @@ export interface Activity {
/**
* A value that is associated with the activity.
*/
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value?: any;
/**
* The name of the operation associated with an invoke or event activity.
*/
Expand Down Expand Up @@ -877,7 +877,7 @@ export interface ConversationParameters {
/**
* Channel specific payload for creating the conversation
*/
channelData: any; // eslint-disable-line @typescript-eslint/no-explicit-any
channelData: any;
}

/**
Expand Down Expand Up @@ -1121,7 +1121,7 @@ export interface AnimationCard {
/**
* Supplementary parameter for this card
*/
value: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value: any;
}

/**
Expand Down Expand Up @@ -1177,7 +1177,7 @@ export interface AudioCard {
/**
* Supplementary parameter for this card
*/
value: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value: any;
}

/**
Expand Down Expand Up @@ -1263,7 +1263,7 @@ export interface MediaCard {
/**
* Supplementary parameter for this card
*/
value: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value: any;
}

/**
Expand Down Expand Up @@ -1477,7 +1477,7 @@ export interface VideoCard {
/**
* Supplementary parameter for this card
*/
value: any; // eslint-disable-line @typescript-eslint/no-explicit-any
value: any;
}

/**
Expand Down Expand Up @@ -1531,15 +1531,15 @@ export interface Place {
/**
* Address of the place (may be `string` or complex object of type `PostalAddress`)
*/
address: any; // eslint-disable-line @typescript-eslint/no-explicit-any
address: any;
/**
* Geo coordinates of the place (may be complex object of type `GeoCoordinates` or `GeoShape`)
*/
geo: any; // eslint-disable-line @typescript-eslint/no-explicit-any
geo: any;
/**
* Map to the place (may be `string` (URL) or complex object of type `Map`)
*/
hasMap: any; // eslint-disable-line @typescript-eslint/no-explicit-any
hasMap: any;
/**
* The type of the thing
*/
Expand Down Expand Up @@ -1571,7 +1571,7 @@ export interface MediaEventValue {
/**
* Callback parameter specified in the Value field of the MediaCard that originated this event
*/
cardValue: any; // eslint-disable-line @typescript-eslint/no-explicit-any
cardValue: any;
}

/**
Expand All @@ -1585,7 +1585,7 @@ export interface TokenRequest {
/**
* A collection of settings for the specific provider for this request
*/
settings: { [propertyName: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
settings: { [propertyName: string]: any };
}

/**
Expand All @@ -1611,7 +1611,7 @@ export interface TokenResponse {
/**
* A collection of properties about this response, such as token polling parameters
*/
properties?: { [propertyName: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
properties?: { [propertyName: string]: any };
}

/**
Expand Down Expand Up @@ -1779,7 +1779,7 @@ export interface PaymentDetailsModifier {
* A JSON-serializable object that provides optional information that might be needed by the
* supported payment methods
*/
data: any; // eslint-disable-line @typescript-eslint/no-explicit-any
data: any;
}

/**
Expand Down Expand Up @@ -1826,7 +1826,7 @@ export interface PaymentMethodData {
* A JSON-serializable object that provides optional information that might be needed by the
* supported payment methods
*/
data: any; // eslint-disable-line @typescript-eslint/no-explicit-any
data: any;
}

/**
Expand Down Expand Up @@ -1906,7 +1906,7 @@ export interface PaymentResponse {
* A JSON-serializable object that provides a payment method specific message used by the
* merchant to process the transaction and determine successful fund transfer
*/
details: any; // eslint-disable-line @typescript-eslint/no-explicit-any
details: any;
/**
* If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest
* constructor, then shippingAddress will be the full and final shipping address chosen by the
Expand Down Expand Up @@ -2347,7 +2347,7 @@ export interface IStatusCodeError {
* Defines the structure that arrives in the Activity.Value.Authentication for Invoke
* activity with Name of 'adaptiveCard/action'.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface AdaptiveCardAuthentication extends TokenExchangeInvokeRequest {
// No-op. This interface was accidentally created as a duplicate of TokenExchangeInvokeRequest but must remain for backwards-compatibility.
}
Expand Down Expand Up @@ -2439,7 +2439,7 @@ export interface SearchInvokeValue {
* The type of the context field is object and is dependent on the kind field.
* For search and searchAnswers, there is no defined context value.
*/
context: any; // eslint-disable-line @typescript-eslint/no-explicit-any
context: any;
/**
* The dataset to be queried to get the choices.
*/
Expand All @@ -2464,15 +2464,15 @@ export interface SearchInvokeOptions {
* Defines the structure that is returned as the result of an Invoke activity with
* Name of 'application/search'.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface SearchInvokeResponse extends AdaptiveCardInvokeResponse {}

/**
* Represents a response returned by a bot when it receives an `invoke` activity.
*
* This interface supports the framework and is not intended to be called directly for your code.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any

export interface InvokeResponse<T = any> {
/**
* The HTTP status code of the response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { CardButtonBase } from './cardButtonBase';
/**
* Search box button properties.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface ICardSearchBoxButton extends CardButtonBase {
// reserved for future. Not additional properties.
}
Expand Down
Loading
Loading