-
-
Notifications
You must be signed in to change notification settings - Fork 75
refactor(core): enhance class implementations and documentation #162
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
base: main
Are you sure you want to change the base?
Conversation
…erfaces - Updated .oxlintrc.json to enable @typescript-eslint/no-unsafe-declaration-merging rule - Updated Api, Field, Operation, and Resource classes to implement their respective options interfaces. - Declare all the fields in the classes instead of relying on interface declaration merging - Update openapi3 test to take new fields order Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
- Removed assignSealed utility function. - Updated constructors in Api, Field, Operation, and Resource classes to use Object.assign for property assignment. Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
- Edit .oxlintrc.json to enable jsdoc plugin - Added parameter and return type annotations in buildEnumObject, getType, fetchJsonLd, parseHydraDocumentation, and handleJson functions. Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
…ntation Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
…ormat - Changed lint:fix command to include --fix-suggestions - Updated runtime version format to include a space Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Coverage Report
File Coverage
|
There was a problem hiding this 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 PR refactors core classes to implement their options interfaces directly, removes a custom utility function in favor of native JavaScript, and improves JSDoc documentation consistency. The changes focus on making the codebase more maintainable while enhancing type safety and documentation quality.
- Refactored Api, Field, Operation, and Resource classes to implement their options interfaces with explicit property declarations
- Replaced the custom
assignSealed
utility with nativeObject.assign
for property assignment - Standardized JSDoc comments to use proper type annotations and parameter descriptions
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/core/Api.ts | Implements ApiOptions interface with explicit property declarations and Object.assign |
src/core/Field.ts | Implements FieldOptions interface with explicit property declarations and Object.assign |
src/core/Operation.ts | Implements OperationOptions interface with explicit property declarations and Object.assign |
src/core/Resource.ts | Implements ResourceOptions interface with explicit property declarations and Object.assign |
src/core/utils/assignSealed.ts | Removes the custom assignSealed utility function |
src/core/utils/index.ts | Removes export of assignSealed function |
src/core/index.ts | Adds export for types module |
package.json | Adds core module exports and updates linting command |
.oxlintrc.json | Updates linting rules configuration |
src/core/utils/getType.ts | Standardizes JSDoc parameter and return type annotations |
src/core/utils/buildEnumObject.ts | Standardizes JSDoc parameter and return type annotations |
src/hydra/fetchJsonLd.ts | Adds JSDoc parameter and return type annotations |
src/hydra/parseHydraDocumentation.ts | Adds comprehensive JSDoc documentation with type annotations |
src/openapi3/handleJson.ts | Adds return type annotation and standardizes JSDoc |
src/openapi3/handleJson.test.ts | Reorders test data structure (parameters moved after operations) |
🔄 Refactored core classes (Api, Field, Operation, Resource) to implement their respective options interfaces.
🧹 Removed the
assignSealed
utility function and replaced it withObject.assign
for property assignment.📜 Improved JSDoc comments for better clarity and type annotations.
📦 Updated package.json to include exports for core module types and adjusted linting commands.
🗑️ Cleaned up unused Oxlint and Unicorn rules in the configuration.