From 46185c5afa9abdd047154168e31d78ef1f36fc5f Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Thu, 18 Jan 2024 16:29:01 -0500 Subject: [PATCH] lint: enforce max line length / max items per line / one item per line for imports using import-newlines eslint plugin. --- lint-configs/.eslintrc.js | 12 +- packages/logger/package.json | 7 +- packages/oauth/package.json | 1 + packages/rtm-api/package.json | 1 + packages/socket-mode/package.json | 5 +- packages/types/package.json | 1 + .../types/src/block-kit/block-elements.ts | 9 +- packages/types/src/block-kit/blocks.ts | 24 +- packages/web-api/package.json | 1 + packages/web-api/src/WebClient.ts | 19 +- packages/web-api/src/file-upload.ts | 9 +- packages/web-api/src/methods.ts | 305 ++++++++++++++---- .../src/types/request/admin/conversations.ts | 8 +- .../web-api/src/types/request/admin/users.ts | 9 +- packages/web-api/src/types/request/chat.ts | 15 +- .../src/types/request/conversations.ts | 8 +- packages/web-api/src/types/request/files.ts | 7 +- .../web-api/src/types/request/reactions.ts | 10 +- packages/web-api/src/types/request/stars.ts | 10 +- packages/web-api/src/types/request/team.ts | 8 +- packages/webhook/package.json | 5 +- 21 files changed, 379 insertions(+), 95 deletions(-) diff --git a/lint-configs/.eslintrc.js b/lint-configs/.eslintrc.js index ea7ac3ea4..ec4927554 100644 --- a/lint-configs/.eslintrc.js +++ b/lint-configs/.eslintrc.js @@ -13,6 +13,8 @@ const jsDocRecommendedRulesOff = Object.assign( ...Object.keys(jsDocPlugin.configs.recommended.rules).map((rule) => ({ [rule]: 'off' })), ); +const MAX_LINE_LENGTH = 120; + module.exports = { // This is a root of the project, ESLint should not look through parent directories to find more config root: true, @@ -77,7 +79,7 @@ module.exports = { project: './tsconfig.eslint.json', }, // Allow ESLint to load rules from the TypeScript plugin - plugins: ['@typescript-eslint'], + plugins: ['@typescript-eslint', 'import-newlines'], extends: [ // TypeScript plugin's recommended rules 'plugin:@typescript-eslint/recommended', @@ -108,6 +110,12 @@ module.exports = { // NOTE: Consider contributing this to the `airbnb-typescript` config. 'import/named': 'off', 'node/no-missing-import': 'off', + // Enforce how `import`s can be organized across multiple lines / maximum char lengths + 'import-newlines/enforce': ['error', { + items: 4, // maximum number of import items per line, but all imports must fit within max-len + 'max-len': MAX_LINE_LENGTH, // if imports can be kept to one line AND fit within max-len, great + forceSingleLine: false, // dont force single-line imports as long as the previous two rules are OK + }], // Prefer an interface declaration over a type alias because interfaces can be extended, implemented, and merged '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], @@ -169,7 +177,7 @@ module.exports = { // configurations in both JavaScript and TypeScript. // Increase the max line length to 120. The rest of this setting is copied from the AirBnB config. - 'max-len': ['error', 120, 2, { + 'max-len': ['error', MAX_LINE_LENGTH, 2, { ignoreUrls: true, ignoreComments: false, ignoreRegExpLiterals: true, diff --git a/packages/logger/package.json b/packages/logger/package.json index 71c62a796..b6de34693 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -41,23 +41,24 @@ }, "devDependencies": { "@microsoft/api-extractor": "^7.36.4", - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", "chai": "^4.3.8", "eslint": "^8.47.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "shx": "^0.3.2", - "ts-node": "^8.2.0", "sinon": "^15.2.0", "source-map-support": "^0.5.21", + "ts-node": "^8.2.0", "typescript": "^4.1.0" } } diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 908cf4a32..d0d62d81b 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -57,6 +57,7 @@ "eslint-config-airbnb-base": "^15", "eslint-config-airbnb-typescript": "^17", "eslint-plugin-import": "^2", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^48", "eslint-plugin-node": "^11", "mocha": "^10", diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index 07d9f8565..e766c4fd4 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -61,6 +61,7 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "shx": "^0.3.2", diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index 277cbdb85..983153ab1 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -56,15 +56,16 @@ "ws": "^7.5.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", "chai": "^4.3.8", "eslint": "^8.47.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0", diff --git a/packages/types/package.json b/packages/types/package.json index d42cf2d90..f4b603993 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -43,6 +43,7 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "shx": "^0.3.2", diff --git a/packages/types/src/block-kit/block-elements.ts b/packages/types/src/block-kit/block-elements.ts index 6080ffb2f..c2c4d09b8 100644 --- a/packages/types/src/block-kit/block-elements.ts +++ b/packages/types/src/block-kit/block-elements.ts @@ -1,6 +1,13 @@ // This file contains objects documented here: https://api.slack.com/reference/block-kit/block-elements -import { Actionable, Confirmable, Dispatchable, Focusable, Placeholdable, RichTextStyleable } from './extensions'; +import { + Actionable, + Confirmable, + Dispatchable, + Focusable, + Placeholdable, + RichTextStyleable, +} from './extensions'; import { Option, PlainTextElement, PlainTextOption } from './composition-objects'; import { RichTextBlock } from './blocks'; diff --git a/packages/types/src/block-kit/blocks.ts b/packages/types/src/block-kit/blocks.ts index 9a8b434d7..f62ded76a 100644 --- a/packages/types/src/block-kit/blocks.ts +++ b/packages/types/src/block-kit/blocks.ts @@ -2,7 +2,29 @@ import { PlainTextElement, MrkdwnElement } from './composition-objects'; import { Actionable } from './extensions'; -import { Button, Checkboxes, Datepicker, DateTimepicker, EmailInput, FileInput, ImageElement, MultiSelect, NumberInput, Overflow, PlainTextInput, RadioButtons, Select, Timepicker, URLInput, WorkflowButton, RichTextSection, RichTextList, RichTextQuote, RichTextPreformatted, RichTextInput } from './block-elements'; +import { + Button, + Checkboxes, + Datepicker, + DateTimepicker, + EmailInput, + FileInput, + ImageElement, + MultiSelect, + NumberInput, + Overflow, + PlainTextInput, + RadioButtons, + Select, + Timepicker, + URLInput, + WorkflowButton, + RichTextSection, + RichTextList, + RichTextQuote, + RichTextPreformatted, + RichTextInput, +} from './block-elements'; export interface Block { type: string; diff --git a/packages/web-api/package.json b/packages/web-api/package.json index 47b7f5732..14325d147 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -72,6 +72,7 @@ "eslint-config-airbnb-base": "^15", "eslint-config-airbnb-typescript": "^17", "eslint-plugin-import": "^2", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^48", "eslint-plugin-node": "^11", "mocha": "^10", diff --git a/packages/web-api/src/WebClient.ts b/packages/web-api/src/WebClient.ts index f5b8688bd..02e5d34e6 100644 --- a/packages/web-api/src/WebClient.ts +++ b/packages/web-api/src/WebClient.ts @@ -22,15 +22,28 @@ import { } from './types/response'; import { CursorPaginationEnabled } from './types/request/common'; import { Methods } from './methods'; -import type { FilesUploadV2Arguments, FileUploadV2Job, FilesGetUploadURLExternalArguments, FilesCompleteUploadExternalArguments } from './types/request/files'; +import type { + FilesUploadV2Arguments, + FileUploadV2Job, + FilesGetUploadURLExternalArguments, + FilesCompleteUploadExternalArguments, +} from './types/request/files'; import { getUserAgent } from './instrument'; import { - requestErrorWithOriginal, httpErrorFromResponse, platformErrorFromResult, rateLimitedErrorWithDelay, + requestErrorWithOriginal, + httpErrorFromResponse, + platformErrorFromResult, + rateLimitedErrorWithDelay, } from './errors'; import { LogLevel, Logger, getLogger } from './logger'; import { RetryOptions, tenRetriesInAboutThirtyMinutes } from './retry-policies'; import delay from './helpers'; -import { warnIfNotUsingFilesUploadV2, getFileUploadJob, getMultipleFileUploadJobs, getAllFileUploadsToComplete } from './file-upload'; +import { + warnIfNotUsingFilesUploadV2, + getFileUploadJob, + getMultipleFileUploadJobs, + getAllFileUploadsToComplete, +} from './file-upload'; /* * Helpers diff --git a/packages/web-api/src/file-upload.ts b/packages/web-api/src/file-upload.ts index a0b850718..34f7417a4 100644 --- a/packages/web-api/src/file-upload.ts +++ b/packages/web-api/src/file-upload.ts @@ -2,7 +2,14 @@ import { readFileSync } from 'fs'; import { Readable } from 'stream'; import { Logger } from '@slack/logger'; import { errorWithCode, ErrorCode } from './errors'; -import { FilesCompleteUploadExternalArguments, FilesUploadV2Arguments, FileUploadBinaryContents, FileUploadStringContents, FileUploadV2, FileUploadV2Job } from './types/request/files'; +import { + FilesCompleteUploadExternalArguments, + FilesUploadV2Arguments, + FileUploadBinaryContents, + FileUploadStringContents, + FileUploadV2, + FileUploadV2Job, +} from './types/request/files'; export async function getFileUploadJob( options: FilesUploadV2Arguments | FileUploadV2, diff --git a/packages/web-api/src/methods.ts b/packages/web-api/src/methods.ts index eb80e817d..c22ec93de 100644 --- a/packages/web-api/src/methods.ts +++ b/packages/web-api/src/methods.ts @@ -239,77 +239,240 @@ import type { } from './types/response/index'; // Request types import type { - WorkflowsStepCompletedArguments, WorkflowsStepFailedArguments, WorkflowsUpdateStepArguments, ViewsUpdateArguments, - ViewsOpenArguments, ViewsPushArguments, ViewsPublishArguments, UsersConversationsArguments, UsersInfoArguments, - UsersListArguments, UsersIdentityArguments, UsersSetPhotoArguments, UsersProfileGetArguments, - UsersProfileSetArguments, UsersDeletePhotoArguments, UsersGetPresenceArguments, UsersSetPresenceArguments, - UsersLookupByEmailArguments, ToolingTokensRotateArguments, SearchAllArguments, SearchFilesArguments, - SearchMessagesArguments, UsergroupsCreateArguments, UsergroupsDisableArguments, UsergroupsEnableArguments, - UsergroupsListArguments, UsergroupsUpdateArguments, UsergroupsUsersListArguments, UsergroupsUsersUpdateArguments, - TeamAccessLogsArguments, TeamBillableInfoArguments, TeamBillingInfoArguments, TeamInfoArguments, - TeamIntegrationLogsArguments, TeamPreferencesListArguments, TeamProfileGetArguments, StarsAddRemoveArguments, - StarsListArguments, RTMConnectArguments, RTMStartArguments, RemindersAddArguments, RemindersInfoArguments, - RemindersListArguments, RemindersDeleteArguments, RemindersCompleteArguments, ReactionsAddArguments, - ReactionsGetArguments, ReactionsListArguments, ReactionsRemoveArguments, PinsAddArguments, PinsListArguments, - PinsRemoveArguments, OpenIDConnectTokenArguments, OpenIDConnectUserInfoArguments, OAuthAccessArguments, - OAuthV2AccessArguments, OAuthV2ExchangeArguments, MigrationExchangeArguments, FilesDeleteArguments, - FunctionsCompleteErrorArguments, FunctionsCompleteSuccessArguments, - FilesInfoArguments, FilesListArguments, FilesRevokePublicURLArguments, FilesSharedPublicURLArguments, - FilesUploadArguments, FilesUploadV2Arguments, FilesCompleteUploadExternalArguments, - FilesGetUploadURLExternalArguments, FilesCommentsDeleteArguments, FilesRemoteUpdateArguments, - FilesRemoteRemoveArguments, FilesRemoteShareArguments, FilesRemoteListArguments, FilesRemoteInfoArguments, - FilesRemoteAddArguments, EmojiListArguments, DndEndDndArguments, DndEndSnoozeArguments, DndInfoArguments, - DndSetSnoozeArguments, DndTeamInfoArguments, DialogOpenArguments, ConversationsAcceptSharedInviteArguments, - ConversationsApproveSharedInviteArguments, ConversationsArchiveArguments, ConversationsCloseArguments, - ConversationsCreateArguments, ConversationsDeclineSharedInviteArguments, ConversationsHistoryArguments, - ConversationsInfoArguments, ConversationsInviteArguments, ConversationsInviteSharedArguments, - ConversationsJoinArguments, ConversationsKickArguments, ConversationsLeaveArguments, ConversationsListArguments, - ConversationsListConnectInvitesArguments, ConversationsMarkArguments, ConversationsMembersArguments, - ConversationsOpenArguments, ConversationsRenameArguments, ConversationsRepliesArguments, - ConversationsSetPurposeArguments, ConversationsSetTopicArguments, ConversationsUnarchiveArguments, - ChatDeleteArguments, ChatDeleteScheduledMessageArguments, ChatGetPermalinkArguments, ChatMeMessageArguments, - ChatPostEphemeralArguments, ChatPostMessageArguments, ChatScheduleMessageArguments, - ChatScheduledMessagesListArguments, ChatUnfurlArguments, ChatUpdateArguments, - CallsAddArguments, CallsEndArguments, CallsInfoArguments, CallsUpdateArguments, CallsParticipantsAddArguments, - CallsParticipantsRemoveArguments, BotsInfoArguments, BookmarksAddArguments, BookmarksEditArguments, - BookmarksListArguments, BookmarksRemoveArguments, AuthRevokeArguments, AuthTestArguments, AuthTeamsListArguments, - AppsConnectionsOpenArguments, AppsEventAuthorizationsListArguments, AppsManifestCreateArguments, - AppsManifestDeleteArguments, AppsManifestExportArguments, AppsManifestUpdateArguments, - AppsManifestValidateArguments, AppsUninstallArguments, APITestArguments, AdminAnalyticsGetFileArguments, - AdminAppsActivitiesListArguments, AdminAppsApproveArguments, AdminAppsApprovedListArguments, - AdminAppsClearResolutionArguments, AdminAppsConfigLookupArguments, AdminAppsConfigSetArguments, - AdminAppsRequestsCancelArguments, AdminAppsRequestsListArguments, AdminAppsRestrictArguments, - AdminAppsRestrictedListArguments, AdminAppsUninstallArguments, AdminAuthPolicyAssignEntitiesArguments, - AdminAuthPolicyGetEntitiesArguments, AdminAuthPolicyRemoveEntitiesArguments, AdminBarriersCreateArguments, - AdminBarriersDeleteArguments, AdminBarriersListArguments, AdminBarriersUpdateArguments, - AdminConversationsArchiveArguments, AdminConversationsBulkArchiveArguments, AdminConversationsBulkDeleteArguments, - AdminConversationsBulkMoveArguments, AdminConversationsConvertToPrivateArguments, - AdminConversationsConvertToPublicArguments, AdminConversationsCreateArguments, AdminConversationsDeleteArguments, - AdminConversationsDisconnectSharedArguments, AdminConversationsEKMListOriginalConnectedChannelInfoArguments, - AdminConversationsGetConversationPrefsArguments, AdminConversationsGetCustomRetentionArguments, - AdminConversationsGetTeamsArguments, AdminConversationsInviteArguments, AdminConversationsLookupArguments, - AdminConversationsRemoveCustomRetentionArguments, AdminConversationsRenameArguments, - AdminConversationsRestrictAccessAddGroupArguments, AdminConversationsRestrictAccessListGroupsArguments, - AdminConversationsRestrictAccessRemoveGroupArguments, AdminConversationsSearchArguments, - AdminConversationsSetConversationPrefsArguments, AdminConversationsSetCustomRetentionArguments, - AdminConversationsSetTeamsArguments, AdminConversationsUnarchiveArguments, AdminEmojiAddArguments, - AdminEmojiAddAliasArguments, AdminEmojiListArguments, AdminEmojiRemoveArguments, AdminEmojiRenameArguments, - AdminFunctionsListArguments, AdminFunctionsPermissionsLookupArguments, AdminFunctionsPermissionsSetArguments, - AdminInviteRequestsApproveArguments, AdminInviteRequestsApprovedListArguments, - AdminInviteRequestsDeniedListArguments, AdminInviteRequestsDenyArguments, AdminInviteRequestsListArguments, - AdminRolesAddAssignmentsArguments, AdminRolesListAssignmentsArguments, AdminRolesRemoveAssignmentsArguments, - AdminTeamsAdminsListArguments, AdminTeamsCreateArguments, AdminTeamsListArguments, AdminTeamsOwnersListArguments, - AdminTeamsSettingsInfoArguments, AdminTeamsSettingsSetDefaultChannelsArguments, - AdminTeamsSettingsSetDescriptionArguments, AdminTeamsSettingsSetDiscoverabilityArguments, - AdminTeamsSettingsSetIconArguments, AdminTeamsSettingsSetNameArguments, AdminUsergroupsAddChannelsArguments, - AdminUsergroupsAddTeamsArguments, AdminUsergroupsListChannelsArguments, AdminUsergroupsRemoveChannelsArguments, - AdminUsersAssignArguments, AdminUsersInviteArguments, AdminUsersListArguments, AdminUsersRemoveArguments, - AdminUsersSessionListArguments, AdminUsersSessionClearSettingsArguments, AdminUsersSessionGetSettingsArguments, - AdminUsersSessionInvalidateArguments, AdminUsersSessionResetArguments, AdminUsersSessionResetBulkArguments, - AdminUsersSessionSetSettingsArguments, AdminUsersSetAdminArguments, AdminUsersSetExpirationArguments, - AdminUsersSetOwnerArguments, AdminUsersSetRegularArguments, AdminUsersUnsupportedVersionsExportArguments, - AdminWorkflowsCollaboratorsAddArguments, AdminWorkflowsCollaboratorsRemoveArguments, - AdminWorkflowsPermissionsLookupArguments, AdminWorkflowsSearchArguments, AdminWorkflowsUnpublishArguments, + WorkflowsStepCompletedArguments, + WorkflowsStepFailedArguments, + WorkflowsUpdateStepArguments, + ViewsUpdateArguments, + ViewsOpenArguments, + ViewsPushArguments, + ViewsPublishArguments, + UsersConversationsArguments, + UsersInfoArguments, + UsersListArguments, + UsersIdentityArguments, + UsersSetPhotoArguments, + UsersProfileGetArguments, + UsersProfileSetArguments, + UsersDeletePhotoArguments, + UsersGetPresenceArguments, + UsersSetPresenceArguments, + UsersLookupByEmailArguments, + ToolingTokensRotateArguments, + SearchAllArguments, + SearchFilesArguments, + SearchMessagesArguments, + UsergroupsCreateArguments, + UsergroupsDisableArguments, + UsergroupsEnableArguments, + UsergroupsListArguments, + UsergroupsUpdateArguments, + UsergroupsUsersListArguments, + UsergroupsUsersUpdateArguments, + TeamAccessLogsArguments, + TeamBillableInfoArguments, + TeamBillingInfoArguments, + TeamInfoArguments, + TeamIntegrationLogsArguments, + TeamPreferencesListArguments, + TeamProfileGetArguments, + StarsAddRemoveArguments, + StarsListArguments, + RTMConnectArguments, + RTMStartArguments, + RemindersAddArguments, + RemindersInfoArguments, + RemindersListArguments, + RemindersDeleteArguments, + RemindersCompleteArguments, + ReactionsAddArguments, + ReactionsGetArguments, + ReactionsListArguments, + ReactionsRemoveArguments, + PinsAddArguments, + PinsListArguments, + PinsRemoveArguments, + OpenIDConnectTokenArguments, + OpenIDConnectUserInfoArguments, + OAuthAccessArguments, + OAuthV2AccessArguments, + OAuthV2ExchangeArguments, + MigrationExchangeArguments, + FilesDeleteArguments, + FunctionsCompleteErrorArguments, + FunctionsCompleteSuccessArguments, + FilesInfoArguments, + FilesListArguments, + FilesRevokePublicURLArguments, + FilesSharedPublicURLArguments, + FilesUploadArguments, + FilesUploadV2Arguments, + FilesCompleteUploadExternalArguments, + FilesGetUploadURLExternalArguments, + FilesCommentsDeleteArguments, + FilesRemoteUpdateArguments, + FilesRemoteRemoveArguments, + FilesRemoteShareArguments, + FilesRemoteListArguments, + FilesRemoteInfoArguments, + FilesRemoteAddArguments, + EmojiListArguments, + DndEndDndArguments, + DndEndSnoozeArguments, + DndInfoArguments, + DndSetSnoozeArguments, + DndTeamInfoArguments, + DialogOpenArguments, + ConversationsAcceptSharedInviteArguments, + ConversationsApproveSharedInviteArguments, + ConversationsArchiveArguments, + ConversationsCloseArguments, + ConversationsCreateArguments, + ConversationsDeclineSharedInviteArguments, + ConversationsHistoryArguments, + ConversationsInfoArguments, + ConversationsInviteArguments, + ConversationsInviteSharedArguments, + ConversationsJoinArguments, + ConversationsKickArguments, + ConversationsLeaveArguments, + ConversationsListArguments, + ConversationsListConnectInvitesArguments, + ConversationsMarkArguments, + ConversationsMembersArguments, + ConversationsOpenArguments, + ConversationsRenameArguments, + ConversationsRepliesArguments, + ConversationsSetPurposeArguments, + ConversationsSetTopicArguments, + ConversationsUnarchiveArguments, + ChatDeleteArguments, + ChatDeleteScheduledMessageArguments, + ChatGetPermalinkArguments, + ChatMeMessageArguments, + ChatPostEphemeralArguments, + ChatPostMessageArguments, + ChatScheduleMessageArguments, + ChatScheduledMessagesListArguments, + ChatUnfurlArguments, + ChatUpdateArguments, + CallsAddArguments, + CallsEndArguments, + CallsInfoArguments, + CallsUpdateArguments, + CallsParticipantsAddArguments, + CallsParticipantsRemoveArguments, + BotsInfoArguments, + BookmarksAddArguments, + BookmarksEditArguments, + BookmarksListArguments, + BookmarksRemoveArguments, + AuthRevokeArguments, + AuthTestArguments, + AuthTeamsListArguments, + AppsConnectionsOpenArguments, + AppsEventAuthorizationsListArguments, + AppsManifestCreateArguments, + AppsManifestDeleteArguments, + AppsManifestExportArguments, + AppsManifestUpdateArguments, + AppsManifestValidateArguments, + AppsUninstallArguments, + APITestArguments, + AdminAnalyticsGetFileArguments, + AdminAppsActivitiesListArguments, + AdminAppsApproveArguments, + AdminAppsApprovedListArguments, + AdminAppsClearResolutionArguments, + AdminAppsConfigLookupArguments, + AdminAppsConfigSetArguments, + AdminAppsRequestsCancelArguments, + AdminAppsRequestsListArguments, + AdminAppsRestrictArguments, + AdminAppsRestrictedListArguments, + AdminAppsUninstallArguments, + AdminAuthPolicyAssignEntitiesArguments, + AdminAuthPolicyGetEntitiesArguments, + AdminAuthPolicyRemoveEntitiesArguments, + AdminBarriersCreateArguments, + AdminBarriersDeleteArguments, + AdminBarriersListArguments, + AdminBarriersUpdateArguments, + AdminConversationsArchiveArguments, + AdminConversationsBulkArchiveArguments, + AdminConversationsBulkDeleteArguments, + AdminConversationsBulkMoveArguments, + AdminConversationsConvertToPrivateArguments, + AdminConversationsConvertToPublicArguments, + AdminConversationsCreateArguments, + AdminConversationsDeleteArguments, + AdminConversationsDisconnectSharedArguments, + AdminConversationsEKMListOriginalConnectedChannelInfoArguments, + AdminConversationsGetConversationPrefsArguments, + AdminConversationsGetCustomRetentionArguments, + AdminConversationsGetTeamsArguments, + AdminConversationsInviteArguments, + AdminConversationsLookupArguments, + AdminConversationsRemoveCustomRetentionArguments, + AdminConversationsRenameArguments, + AdminConversationsRestrictAccessAddGroupArguments, + AdminConversationsRestrictAccessListGroupsArguments, + AdminConversationsRestrictAccessRemoveGroupArguments, + AdminConversationsSearchArguments, + AdminConversationsSetConversationPrefsArguments, + AdminConversationsSetCustomRetentionArguments, + AdminConversationsSetTeamsArguments, + AdminConversationsUnarchiveArguments, + AdminEmojiAddArguments, + AdminEmojiAddAliasArguments, + AdminEmojiListArguments, + AdminEmojiRemoveArguments, + AdminEmojiRenameArguments, + AdminFunctionsListArguments, + AdminFunctionsPermissionsLookupArguments, + AdminFunctionsPermissionsSetArguments, + AdminInviteRequestsApproveArguments, + AdminInviteRequestsApprovedListArguments, + AdminInviteRequestsDeniedListArguments, + AdminInviteRequestsDenyArguments, + AdminInviteRequestsListArguments, + AdminRolesAddAssignmentsArguments, + AdminRolesListAssignmentsArguments, + AdminRolesRemoveAssignmentsArguments, + AdminTeamsAdminsListArguments, + AdminTeamsCreateArguments, + AdminTeamsListArguments, + AdminTeamsOwnersListArguments, + AdminTeamsSettingsInfoArguments, + AdminTeamsSettingsSetDefaultChannelsArguments, + AdminTeamsSettingsSetDescriptionArguments, + AdminTeamsSettingsSetDiscoverabilityArguments, + AdminTeamsSettingsSetIconArguments, + AdminTeamsSettingsSetNameArguments, + AdminUsergroupsAddChannelsArguments, + AdminUsergroupsAddTeamsArguments, + AdminUsergroupsListChannelsArguments, + AdminUsergroupsRemoveChannelsArguments, + AdminUsersAssignArguments, + AdminUsersInviteArguments, + AdminUsersListArguments, + AdminUsersRemoveArguments, + AdminUsersSessionListArguments, + AdminUsersSessionClearSettingsArguments, + AdminUsersSessionGetSettingsArguments, + AdminUsersSessionInvalidateArguments, + AdminUsersSessionResetArguments, + AdminUsersSessionResetBulkArguments, + AdminUsersSessionSetSettingsArguments, + AdminUsersSetAdminArguments, + AdminUsersSetExpirationArguments, + AdminUsersSetOwnerArguments, + AdminUsersSetRegularArguments, + AdminUsersUnsupportedVersionsExportArguments, + AdminWorkflowsCollaboratorsAddArguments, + AdminWorkflowsCollaboratorsRemoveArguments, + AdminWorkflowsPermissionsLookupArguments, + AdminWorkflowsSearchArguments, + AdminWorkflowsUnpublishArguments, } from './types/request/index'; /** diff --git a/packages/web-api/src/types/request/admin/conversations.ts b/packages/web-api/src/types/request/admin/conversations.ts index 40796e908..8da69260d 100644 --- a/packages/web-api/src/types/request/admin/conversations.ts +++ b/packages/web-api/src/types/request/admin/conversations.ts @@ -1,4 +1,10 @@ -import type { ChannelIDs, CursorPaginationEnabled, SortDir, TokenOverridable, UserIDs } from '../common'; +import type { + ChannelIDs, + CursorPaginationEnabled, + SortDir, + TokenOverridable, + UserIDs, +} from '../common'; interface ChannelID { // an identical interface exists in src/types/request/conversations.ts, but it is only for invites /** @description Encoded channel ID. */ diff --git a/packages/web-api/src/types/request/admin/users.ts b/packages/web-api/src/types/request/admin/users.ts index cc017f6dd..4f8e0eaa5 100644 --- a/packages/web-api/src/types/request/admin/users.ts +++ b/packages/web-api/src/types/request/admin/users.ts @@ -1,4 +1,11 @@ -import type { ChannelIDs, CursorPaginationEnabled, OptionalTeamAssignable, TeamID, TokenOverridable, UserIDs } from '../common'; +import type { + ChannelIDs, + CursorPaginationEnabled, + OptionalTeamAssignable, + TeamID, + TokenOverridable, + UserIDs, +} from '../common'; interface UserID { /** @description The ID of the user. */ diff --git a/packages/web-api/src/types/request/chat.ts b/packages/web-api/src/types/request/chat.ts index 623e67b36..70e21624f 100644 --- a/packages/web-api/src/types/request/chat.ts +++ b/packages/web-api/src/types/request/chat.ts @@ -1,5 +1,16 @@ -import type { KnownBlock, Block, MessageAttachment, LinkUnfurls, MessageMetadata } from '@slack/types'; -import type { CursorPaginationEnabled, OptionalTeamAssignable, TimelinePaginationEnabled, TokenOverridable } from './common'; +import type { + KnownBlock, + Block, + MessageAttachment, + LinkUnfurls, + MessageMetadata, +} from '@slack/types'; +import type { + CursorPaginationEnabled, + OptionalTeamAssignable, + TimelinePaginationEnabled, + TokenOverridable, +} from './common'; interface Channel { /** @description Channel ID for the message. */ diff --git a/packages/web-api/src/types/request/conversations.ts b/packages/web-api/src/types/request/conversations.ts index 781d76b68..14892fdd3 100644 --- a/packages/web-api/src/types/request/conversations.ts +++ b/packages/web-api/src/types/request/conversations.ts @@ -1,4 +1,10 @@ -import type { CursorPaginationEnabled, LocaleAware, OptionalTeamAssignable, TimelinePaginationEnabled, TokenOverridable } from './common'; +import type { + CursorPaginationEnabled, + LocaleAware, + OptionalTeamAssignable, + TimelinePaginationEnabled, + TokenOverridable, +} from './common'; interface Channel { /** @description ID of conversation. */ diff --git a/packages/web-api/src/types/request/files.ts b/packages/web-api/src/types/request/files.ts index b4e181075..741f77b99 100644 --- a/packages/web-api/src/types/request/files.ts +++ b/packages/web-api/src/types/request/files.ts @@ -1,5 +1,10 @@ import type { Stream } from 'node:stream'; -import type { CursorPaginationEnabled, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; +import type { + CursorPaginationEnabled, + OptionalTeamAssignable, + TokenOverridable, + TraditionalPagingEnabled, +} from './common'; import type { FilesGetUploadURLExternalResponse } from '../response/index'; interface FileArgument { diff --git a/packages/web-api/src/types/request/reactions.ts b/packages/web-api/src/types/request/reactions.ts index da2c21ea3..97509fa13 100644 --- a/packages/web-api/src/types/request/reactions.ts +++ b/packages/web-api/src/types/request/reactions.ts @@ -1,4 +1,12 @@ -import { CursorPaginationEnabled, FileArgument, FileCommentArgument, MessageArgument, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; +import { + CursorPaginationEnabled, + FileArgument, + FileCommentArgument, + MessageArgument, + OptionalTeamAssignable, + TokenOverridable, + TraditionalPagingEnabled, +} from './common'; interface ReactionsFull { /** @description If `true`, return the complete reaction list. */ diff --git a/packages/web-api/src/types/request/stars.ts b/packages/web-api/src/types/request/stars.ts index 6138b557b..82cf6f3cf 100644 --- a/packages/web-api/src/types/request/stars.ts +++ b/packages/web-api/src/types/request/stars.ts @@ -1,4 +1,12 @@ -import { CursorPaginationEnabled, FileCommentArgument, FileArgument, MessageArgument, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; +import { + CursorPaginationEnabled, + FileCommentArgument, + FileArgument, + MessageArgument, + OptionalTeamAssignable, + TokenOverridable, + TraditionalPagingEnabled, +} from './common'; /** @description When starring something, it can be starred _to_ a channel. */ interface StarsChannelDestination { diff --git a/packages/web-api/src/types/request/team.ts b/packages/web-api/src/types/request/team.ts index b2c9038cd..ed12b997d 100644 --- a/packages/web-api/src/types/request/team.ts +++ b/packages/web-api/src/types/request/team.ts @@ -1,4 +1,10 @@ -import { AppID, OptionalTeamAssignable, TokenOverridable, CursorPaginationEnabled, TraditionalPagingEnabled } from './common'; +import { + AppID, + OptionalTeamAssignable, + TokenOverridable, + CursorPaginationEnabled, + TraditionalPagingEnabled, +} from './common'; // https://api.slack.com/methods/team.accessLogs export interface TeamAccessLogsArguments extends TokenOverridable, CursorPaginationEnabled, diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 2be2a50bd..dbc15bbe0 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -46,15 +46,16 @@ }, "devDependencies": { "@microsoft/api-extractor": "^7.38.0", - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", "chai": "^4.3.8", "eslint": "^8.47.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0",