Skip to content

fix(lint): no require imports#797

Merged
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
Sim-sat:no-require-imports
Mar 1, 2026
Merged

fix(lint): no require imports#797
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
Sim-sat:no-require-imports

Conversation

@Sim-sat
Copy link
Contributor

@Sim-sat Sim-sat commented Mar 1, 2026

Description

Fixes the 1 no-require-imports error from eslint. It also removes the no-explicit-any rule for test files since it's not a problem there.

Related Issue

PR type [ ] Issue [x] New Feature [ ] Documentation
Linked Issue: #795

Checklist

Please check all that apply:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers
  • Tests: I have included automated tests for my changes.
  • [MANDATORY for UI changes] Screenshots: I have attached "Before" vs "After" screenshots below.
  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate (especially for Frontend).
  • Translations: I have only updated the English (en) translation file (if applicable).
  • Architecture: My code follows the existing architecture standards.
  • Database Security: I have updated rls_policies.sql for any new user-specific tables.
  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code(phishing, malware, etc.) and I agree to the License terms.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 focuses on improving the codebase's adherence to linting standards and streamlining the development experience for tests. It addresses a specific no-require-imports error and reduces noise in test files by relaxing the no-explicit-any rule where it's less critical, leading to cleaner and more maintainable test code.

Highlights

  • Linting Fix: Resolved the no-require-imports ESLint error by converting a require statement to an ES module import in a test setup file.
  • ESLint Rule Relaxation for Tests: Disabled the @typescript-eslint/no-explicit-any rule specifically for test files, removing the need for numerous eslint-disable-next-line comments within test code.
Changelog
  • SparkyFitnessFrontend/eslint.config.js
    • Disabled the @typescript-eslint/no-explicit-any rule for all files within the src/tests directory.
  • SparkyFitnessFrontend/src/tests/setupTests.ts
    • Replaced the require('util') statement with an ES module import { TextEncoder, TextDecoder } from 'util' to resolve a linting error.
    • Removed multiple eslint-disable-next-line @typescript-eslint/no-explicit-any comments, as the rule is now globally disabled for test files.
  • SparkyFitnessFrontend/src/tests/test-utils.tsx
    • Removed an eslint-disable-next-line @typescript-eslint/no-explicit-any comment, aligning with the updated ESLint configuration for test files.
Activity
  • The author, Sim-sat, has marked the 'Quality', 'Architecture', and 'Integrity & License' checklist items as complete.
  • The pull request is linked to issue Eslint errors in Frontend #795.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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
Contributor

@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 successfully addresses the no-require-imports linting error by replacing a require() call with a modern import statement. Additionally, it disables the @typescript-eslint/no-explicit-any rule for test files to remove several eslint-disable comments. While the move to import is a good improvement, I have a suggestion regarding the complete disabling of no-explicit-any in tests, as it can impact the long-term maintainability and type-safety of the test suite.

@CodeWithCJ CodeWithCJ merged commit ab31594 into CodeWithCJ:main Mar 1, 2026
6 checks passed
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