-
Notifications
You must be signed in to change notification settings - Fork 443
build(types): improve type safety in some utils #7863
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?
build(types): improve type safety in some utils #7863
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
looks like you need to reformat |
Good catch! I've run the formatter now. |
|
you... undid the changes from |
You were right! I'd accidentally reverted some changes from |
5a3aea2 to
29ca316
Compare
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types. - In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used. - In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`.
29ca316 to
218ca7a
Compare
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types. - In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used. - In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`. chore(format): Run prettier to fix CI formatting issues Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types. - In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used. - In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`. fix(tests): Correctly pass account_id in integration tests The `v2-api.test.ts` integration test was failing because the mock `account_id` was not being correctly passed to the function context. This was due to a logic error in `getSiteInformation` where the `account_id` from `siteInfo` was not being used as a fallback. This commit corrects the logic to ensure the `account_id` is preserved, which resolves the test failure and improves the robustness of the function. Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
serhalp
left a comment
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.
that's it, bad robot, you're fired
Replaces several @ts-expect-error instances and implicit 'any' types with explicit, robust type definitions. - Adds specific types for function parameters in getSiteInformation and getDotEnvVariables, improving clarity and preventing potential runtime errors. - Imports types from @netlify/api and local type definitions to ensure consistency. - Corrects other minor type issues in the module. Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves the TypeScript type safety in `src/utils/dev.ts` and `src/utils/dot-env.ts`. - Replaced `@ts-expect-error` and `any` types with specific, correct types. - Added explicit types for function parameters and return values. - Introduced interfaces for complex objects to ensure type safety. - Fixed cascading type errors in related files (`src/commands/dev-exec/dev-exec.ts`, `src/commands/functions/functions-serve.ts`). Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves the TypeScript type safety in `src/utils/dev.ts` and `src/utils/dot-env.ts`. - Replaced `@ts-expect-error` and `any` types with specific, correct types. - Added explicit types for function parameters and return values. - Introduced interfaces for complex objects to ensure type safety. - Fixed cascading type errors in related files (`src/commands/dev-exec/dev-exec.ts`, `src/commands/functions/functions-serve.ts`). - Addressed feedback from code review to fix a regression in `processOnExit` and remove unrelated changes to `package-lock.json`. Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This submission removes several
@ts-expect-errorcomments and improves the overall type safety of the codebase by fixing the underlying type issues insrc/utils/shell.tsandsrc/utils/dot-env.ts.PR created automatically by Jules for task 12215694966020416008 started by @serhalp