diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index dedca82..24695a2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,8 @@ Describe what this PR changes and why. - [ ] Feature - [ ] Refactor - [ ] Documentation +- [ ] Code improvement / refactoring +- [ ] Other (please describe) ## Breaking change - [ ] Yes @@ -15,4 +17,3 @@ Describe what this PR changes and why. - [ ] Unit tests added/updated - [ ] E2E tests added/updated (if applicable) - [ ] Documentation updated if needed -- [ ] Build and tests pass locally diff --git a/.github/workflows/prettier.yaml b/.github/workflows/code.yaml similarity index 83% rename from .github/workflows/prettier.yaml rename to .github/workflows/code.yaml index ac5c6db..12d4cff 100644 --- a/.github/workflows/prettier.yaml +++ b/.github/workflows/code.yaml @@ -1,4 +1,4 @@ -name: Check formatting +name: Check code on: pull_request: @@ -14,8 +14,8 @@ concurrency: cancel-in-progress: true jobs: - prettier: - name: check formatting + check: + name: check prettier and eslint runs-on: ubuntu-latest steps: @@ -35,3 +35,6 @@ jobs: - name: Check formatting run: yarn format:check + + - name: Check linting + run: yarn lint diff --git a/eslint.config.mjs b/eslint.config.mjs index ed69ade..1cf13b6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -28,6 +28,8 @@ export default tseslint.config( sourceType: 'module', }, rules: { + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/packages/messaging/src/consumer/consumer-message.ts b/packages/messaging/src/consumer/consumer-message.ts index 2323ba6..a22d998 100644 --- a/packages/messaging/src/consumer/consumer-message.ts +++ b/packages/messaging/src/consumer/consumer-message.ts @@ -2,7 +2,7 @@ export class ConsumerMessage { constructor( public readonly message: object | string, public readonly routingKey: string, - public readonly metadata: {} = {}, + public readonly metadata: Record = {}, ) { this.message = message; this.routingKey = routingKey; diff --git a/packages/messaging/src/dependency-injection/decorator.ts b/packages/messaging/src/dependency-injection/decorator.ts index c16c75d..56bf903 100644 --- a/packages/messaging/src/dependency-injection/decorator.ts +++ b/packages/messaging/src/dependency-injection/decorator.ts @@ -11,7 +11,7 @@ export const MESSAGING_EXCEPTION_LISTENER_METADATA = export const MESSAGING_MESSAGE_METADATA = 'MESSAGING_MESSAGE_METADATA'; export const MessageHandler = (...routingKey: string[]): ClassDecorator => { - return (target: Function) => { + return (target) => { Reflect.defineMetadata(MESSAGE_HANDLER_METADATA, routingKey, target); }; }; @@ -19,7 +19,7 @@ export const MessageHandler = (...routingKey: string[]): ClassDecorator => { export const ChannelFactory = ( channelConfig: ChannelConfig, ): ClassDecorator => { - return (target: Function) => { + return (target) => { Reflect.defineMetadata(CHANNEL_FACTORY_METADATA, channelConfig, target); }; }; @@ -27,7 +27,7 @@ export const ChannelFactory = ( export const MessageBusFactory = (channel: any): ClassDecorator => { classValidator(channel, 'Channel'); - return (target: Function) => { + return (target) => { Reflect.defineMetadata(MESSAGE_BUS_FACTORY_METADATA, channel, target); }; }; @@ -35,13 +35,13 @@ export const MessageBusFactory = (channel: any): ClassDecorator => { export const MessageConsumer = (channel: any): ClassDecorator => { classValidator(channel, 'Channel'); - return (target: Function) => { + return (target) => { Reflect.defineMetadata(MESSAGE_CONSUMER_METADATA, channel, target); }; }; export const MessagingMiddleware = (name?: string): ClassDecorator => { - return (target: Function) => { + return (target) => { Reflect.defineMetadata( MESSAGING_MIDDLEWARE_METADATA, name ?? target.name, @@ -51,7 +51,7 @@ export const MessagingMiddleware = (name?: string): ClassDecorator => { }; export const MessagingNormalizer = (name?: string): ClassDecorator => { - return (target: Function) => { + return (target) => { Reflect.defineMetadata( MESSAGING_NORMALIZER_METADATA, name ?? target.name, @@ -61,7 +61,7 @@ export const MessagingNormalizer = (name?: string): ClassDecorator => { }; export const MessagingExceptionListener = (): ClassDecorator => { - return (target: Function) => { + return (target) => { Reflect.defineMetadata( MESSAGING_EXCEPTION_LISTENER_METADATA, target.name,