Skip to content

Conversation

@ecino
Copy link
Member

@ecino ecino commented Sep 10, 2025

Removed ignore from my2 JS files and run pre-commit

Removed ignore from my2 JS files and run pre-commit
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @ecino, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates previously ignored JavaScript files into the ESLint linting process. By removing the ignore rule and running pre-commit hooks, it ensures that a set of my2 related JavaScript files now adhere to the project's established code style and quality standards, improving overall code consistency and maintainability.

Highlights

  • ESLint Configuration Update: The .eslintignore file has been updated to remove the ignore rule for JavaScript files within the my2 directory, specifically my_compassion/**/!(my2*).js.
  • Code Formatting and Consistency: Numerous JavaScript files across the my_compassion module have received formatting adjustments, including whitespace changes, removal of redundant .bind(this) calls, and standardization of JSDoc type annotations (e.g., string to String, boolean to Boolean). These changes are a direct result of applying ESLint rules.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix ESLint issues by enabling linting for my2* JavaScript files and applying the resulting fixes. While many of the changes are beneficial, such as removing unnecessary code and simplifying logic, there's a recurring issue with JSDoc comments. Across multiple files, primitive types like string and boolean have been changed to their capitalized object wrapper counterparts (String, Boolean). This is contrary to JSDoc best practices and can cause confusion. My review focuses on correcting this to ensure documentation clarity and adherence to standards.

/**
* Validates the payment form.
* @returns {boolean} - True if valid, false otherwise.
* @returns {Boolean} - True if valid, false otherwise.

Choose a reason for hiding this comment

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

medium

According to JSDoc standards, primitive types should be in lowercase. {Boolean} refers to the wrapper object, while {boolean} refers to the primitive type. The original {boolean} was correct.

Suggested change
* @returns {Boolean} - True if valid, false otherwise.
* @returns {boolean} - True if valid, false otherwise.

Comment on lines +122 to +125
* @property {String} childId - The ID of the selected child.
* @property {String|null} templateId - The ID of the selected template, or null if not selected.
* @property {String} letterBody - The body text of the letter.
* @property {Array<{filename: String, content: String}>} attachments - The list of base64-encoded attachments.

Choose a reason for hiding this comment

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

medium

Per JSDoc best practices, primitive types should be lowercase (e.g., string). Using String refers to the object wrapper, which is not the intended type here. Please revert these changes to use string.

Suggested change
* @property {String} childId - The ID of the selected child.
* @property {String|null} templateId - The ID of the selected template, or null if not selected.
* @property {String} letterBody - The body text of the letter.
* @property {Array<{filename: String, content: String}>} attachments - The list of base64-encoded attachments.
* @property {string} childId - The ID of the selected child.
* @property {string|null} templateId - The ID of the selected template, or null if not selected.
* @property {string} letterBody - The body text of the letter.
* @property {Array<{filename: string, content: string}>} attachments - The list of base64-encoded attachments.

Comment on lines +206 to +208
* @param {String} mode - Submission mode: `'send'` to submit the letter, `'preview'` to show a preview.
* @param {Object} result - The result object returned by the server.
* @param {string} childId - The ID of the selected child, used in the redirect URL.
* @param {String} childId - The ID of the selected child, used in the redirect URL.

Choose a reason for hiding this comment

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

medium

To adhere to JSDoc standards, primitive types should be in lowercase. Please use string instead of String for these parameters.

Suggested change
* @param {String} mode - Submission mode: `'send'` to submit the letter, `'preview'` to show a preview.
* @param {Object} result - The result object returned by the server.
* @param {string} childId - The ID of the selected child, used in the redirect URL.
* @param {String} childId - The ID of the selected child, used in the redirect URL.
* @param {string} mode - Submission mode: `'send'` to submit the letter, `'preview'` to show a preview.
* @param {Object} result - The result object returned by the server.
* @param {string} childId - The ID of the selected child, used in the redirect URL.

*
* @param {File} file - The file to generate a key for.
* @returns {string} A unique key combining the file's name, size, type, and last modified date.
* @returns {String} A unique key combining the file's name, size, type, and last modified date.

Choose a reason for hiding this comment

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

medium

In JSDoc, it is standard to use lowercase for primitive types. Please change {String} back to {string}.

Suggested change
* @returns {String} A unique key combining the file's name, size, type, and last modified date.
* @returns {string} A unique key combining the file's name, size, type, and last modified date.

*
* @param {File} file - The file to read.
* @returns {Promise<string>} A promise that resolves with the file's Data URL.
* @returns {Promise<String>} A promise that resolves with the file's Data URL.

Choose a reason for hiding this comment

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

medium

To follow JSDoc conventions, primitive types within generic types like Promise should also be lowercase. Please use {Promise<string>} instead of {Promise<String>}.

Suggested change
* @returns {Promise<String>} A promise that resolves with the file's Data URL.
* @returns {Promise<string>} A promise that resolves with the file's Data URL.

/**
* Validates required fields in the current step.
* @returns {boolean} - True if valid, false otherwise.
* @returns {Boolean} - True if valid, false otherwise.

Choose a reason for hiding this comment

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

medium

According to JSDoc standards, primitive types should be in lowercase. {Boolean} refers to the wrapper object, while {boolean} refers to the primitive type. The original {boolean} was correct.

Suggested change
* @returns {Boolean} - True if valid, false otherwise.
* @returns {boolean} - True if valid, false otherwise.

Comment on lines +17 to +18
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Info')

Choose a reason for hiding this comment

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

medium

To adhere to JSDoc standards, primitive types should be in lowercase. Please use string instead of String for these parameters.

Suggested change
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Info')
* @param {string} msg - The message body
* @param {string} title - Optional title (defaults to 'Info')

Comment on lines +30 to +31
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Success')

Choose a reason for hiding this comment

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

medium

To adhere to JSDoc standards, primitive types should be in lowercase. Please use string instead of String for these parameters.

Suggested change
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Success')
* @param {string} msg - The message body
* @param {string} title - Optional title (defaults to 'Success')

Comment on lines +43 to +44
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Warning')

Choose a reason for hiding this comment

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

medium

To adhere to JSDoc standards, primitive types should be in lowercase. Please use string instead of String for these parameters.

Suggested change
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Warning')
* @param {string} msg - The message body
* @param {string} title - Optional title (defaults to 'Warning')

Comment on lines +56 to +57
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Error')

Choose a reason for hiding this comment

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

medium

To adhere to JSDoc standards, primitive types should be in lowercase. Please use string instead of String for these parameters.

Suggested change
* @param {String} msg - The message body
* @param {String} title - Optional title (defaults to 'Error')
* @param {string} msg - The message body
* @param {string} title - Optional title (defaults to 'Error')

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