Skip to content

Feat/husky#13

Merged
Kmario19 merged 5 commits intomainfrom
feat/husky
Apr 3, 2025
Merged

Feat/husky#13
Kmario19 merged 5 commits intomainfrom
feat/husky

Conversation

@Kmario19
Copy link
Owner

@Kmario19 Kmario19 commented Apr 3, 2025

This pull request introduces several changes to improve the codebase, including adding new dependencies, enabling import organization, and reordering imports for consistency. The most important changes are listed below:

Dependencies and Configuration:

  • Enabled import organization in biome.json by setting "enabled": true for the organizeImports option.

Code Quality and Consistency:

  • Reordered import statements in multiple files to maintain a consistent style where third-party imports are listed before local imports.

Pre-commit Hook:

  • Added a pre-commit hook to run pnpm check to ensure code quality before commits.

Copilot AI review requested due to automatic review settings April 3, 2025 17:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances code quality by reordering and consolidating import statements as well as adding new dependencies and a pre-commit hook to run pnpm check. Key changes include:

  • Updating import orders across multiple files for consistency (third-party imports now precede local imports).
  • Enabling import organization via configuration updates.
  • Adding Husky and TSX to the dependency list and establishing a pre-commit hook.

Reviewed Changes

Copilot reviewed 45 out of 49 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/routes/account/debit/controller.test.ts Imported modules reordered for consistency
src/routes/account/credit/schema.test.ts Updated import order
src/routes/account/credit/controller.ts Adjusted type import ordering
src/routes/account/credit/controller.test.ts Reordered imports to prioritize third-party modules
src/routes/account/create/schema.test.ts Reordered import statements
src/routes/account/create/controller.ts Adjusted import ordering
src/routes/account/create/controller.test.ts Removed redundant import and adjusted order
src/models/Transaction.test.ts Import statements reordered
src/models/Account.test.ts Updated import ordering
src/middleware/schemaValidator.ts Adjusted ordering of type and value imports
src/middleware/schemaValidator.test.ts Reordered import statements
src/middleware/errorHandler.test.ts Updated import ordering
src/index.ts Changed ordering of loadEnvironment relative to other imports
src/config/environment.ts Updated import order
src/app.ts Reordered imports ensuring middleware and routes are correctly imported
README.md Updated dependency list with Husky and TSX
Files not reviewed (4)
  • .husky/pre-commit: Language not supported
  • biome.json: Language not supported
  • package.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

src/index.ts:4

  • Consider importing loadEnvironment before connectDB to ensure that environment variables are loaded prior to establishing a database connection.
import loadEnvironment from '@/config/environment';

@Kmario19 Kmario19 requested a review from Copilot April 3, 2025 17:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request improves the codebase by reordering import statements for consistency, adds new dependencies for pre-commit quality checks, and updates the README to document the new Husky and tsx dependencies.

  • Reorders import statements across controllers and tests
  • Adds a pre-commit hook to run code quality checks
  • Updates documentation with Husky and tsx references

Reviewed Changes

Copilot reviewed 44 out of 48 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/routes/account/debit/controller.ts Modified import order; type imports for Express rearranged
src/routes/account/debit/controller.test.ts Reordered imports to include type imports from Express
src/routes/account/credit/schema.test.ts Adjusted import order with zod imports maintained
src/routes/account/credit/controller.ts Reordered type and local imports inconsistently
src/routes/account/credit/controller.test.ts Reordered imports affecting test consistency
src/routes/account/create/schema.test.ts Adjusted order; third-party (zod) comes before local schema
src/routes/account/create/controller.ts Reordering of type and local imports
src/routes/account/create/controller.test.ts Modified import order; local imports are leading
src/models/Transaction.test.ts Reordering of imports; third-party modules grouped appropriately
src/models/Account.test.ts Reordered third-party and local imports appropriately
src/middleware/schemaValidator.ts Updated import syntax for clarity
src/middleware/schemaValidator.test.ts Adjusted import order consistent with related middleware
src/middleware/errorHandler.test.ts Consistent reordering of type and local imports
src/config/environment.ts Reordered dotenv and zod imports
src/app.ts Import order now places local modules before third-party imports (inconsistent with the PR description)
README.md Updated documentation with additional dependency info
Files not reviewed (4)
  • .husky/pre-commit: Language not supported
  • biome.json: Language not supported
  • package.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (6)

src/routes/account/debit/controller.ts:1

  • Import statements should list third-party modules before local modules. Consider reordering the imports so that the 'express' and 'http-status-codes' imports precede the '@/models/Account' and related local imports.
import { Account } from '@/models/Account';

src/routes/account/credit/controller.ts:1

  • The current import order places local modules before third-party modules. To align with the intended style, move third-party imports (such as from 'express' and 'http-status-codes') above local imports.
import { Account } from '@/models/Account';

src/routes/account/credit/controller.test.ts:1

  • Local imports are currently placed before third-party type imports. Consider reordering to have external modules imported first for consistency.
import { Account } from '@/models/Account';

src/routes/account/create/controller.ts:1

  • To maintain consistent import ordering, third-party modules (such as 'express') should be imported before local modules like '@/models/Account'.
import { Account } from '@/models/Account';

src/routes/account/create/controller.test.ts:1

  • The import order has local modules leading; please reorder so that third-party imports (e.g., 'express' types) appear before any local module imports.
import { Account } from '@/models/Account';

src/app.ts:1

  • In 'app.ts', third-party modules should be imported before local modules. Consider moving the 'express' import (currently below local modules) to the top of the file to match the intended ordering.
import errorHandler from '@/middleware/errorHandler';

@Kmario19 Kmario19 requested a review from Copilot April 3, 2025 17:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request improves code consistency by reordering import statements across the project, enabling organized imports via biome.json, and adding a new pre-commit hook for running code quality checks.

  • Reorders and consolidates import statements in multiple files for a consistent style.
  • Enables the import organization feature in biome.json.
  • Updates the README to include references to new dependencies such as Husky and tsx.

Reviewed Changes

Copilot reviewed 45 out of 50 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/routes/account/credit/schema.test.ts Reorders import of schema for consistency
src/routes/account/credit/controller.ts Refactors import order and removes duplicate imports
src/routes/account/credit/controller.test.ts Adjusts import ordering for clarity
src/routes/account/create/*.ts Reorders imports to maintain a consistent style
src/models/*.test.ts Adjusts import ordering in test files
src/middleware/*.ts Updates import declarations for improved clarity
src/index.ts, src/config/environment.ts, src/app.ts Refactors import ordering to align with style guidelines
README.md Adds new dependency details for Husky and tsx
Files not reviewed (5)
  • .husky/pre-commit: Language not supported
  • .vscode/settings.json: Language not supported
  • biome.json: Language not supported
  • package.json: Language not supported
  • pnpm-lock.yaml: Language not supported

@Kmario19 Kmario19 merged commit be2e8eb into main Apr 3, 2025
1 check passed
@Kmario19 Kmario19 deleted the feat/husky branch April 3, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants