Skip to content

chore: improve eslint conf - #5

Merged
akngs merged 4 commits into
mainfrom
chore-improve-eslint-conf
Aug 17, 2025
Merged

chore: improve eslint conf#5
akngs merged 4 commits into
mainfrom
chore-improve-eslint-conf

Conversation

@akngs

@akngs akngs commented Aug 17, 2025

Copy link
Copy Markdown
Owner

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary of Changes

Hello @akngs, 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 enhancing the project's code quality and consistency by significantly refactoring and improving the ESLint configuration. It updates linting rules, integrates better with TypeScript, and refines the scope of code analysis tools like Biome. These changes aim to enforce stricter coding standards and streamline the development workflow.

Highlights

  • Updated ESLint Configuration: The eslint.config.js file has been extensively updated to use the new flat config format, introduce explicit naming for configurations, and refine rule sets for JavaScript, JSDoc, import statements, TypeScript, and SonarJS.
  • Stricter TypeScript Linting: New TypeScript ESLint rules, such as @typescript-eslint/consistent-type-imports, have been enabled to enforce better type import practices, leading to more consistent and readable code.
  • Biome Configuration Refinement: The biome.jsonc configuration has been updated to use the latest schema, enforce double quotes for JavaScript formatting, and adjust the file inclusion/exclusion patterns for more precise code analysis.
  • VS Code and Tooling Alignment: Minor adjustments were made to .vscode/settings.json and vitest.config.ts to align with the updated linting and formatting configurations, ensuring a smoother developer experience.
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.

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

Copy link
Copy Markdown

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 significantly improves the ESLint configuration by migrating to the modern flat config format, which enhances readability and maintainability. The changes across biome.jsonc, tsconfig.json, and package.json align well with this goal. However, I've identified a critical issue in the new eslint.config.js regarding file scoping. The current setup incorrectly applies TypeScript-specific rules to all files, which could lead to linting errors. I've provided detailed suggestions to rectify this by explicitly scoping the rules to TypeScript files. Additionally, I've pointed out a minor opportunity in a test file to refactor the code to avoid disabling a lint rule.

Comment thread eslint.config.js
Comment thread eslint.config.js
Comment thread eslint.config.js
Comment thread eslint.config.js

// eslint
// check for typescript files
{ name: "s4/ts", files: ["src/**/*.ts"] },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In ESLint's flat config, configuration objects without a files property apply to all files by default. This configuration object appears to be a placeholder to satisfy a requirement of typescript-eslint's ts.config() helper. However, a more explicit and clearer approach is to define the files glob in each configuration block that requires it. This placeholder can be removed once the other blocks are correctly scoped.

Comment thread src/types.test.ts
Comment thread src/types.ts
@akngs
akngs merged commit f412c66 into main Aug 17, 2025
4 checks passed
@akngs
akngs deleted the chore-improve-eslint-conf branch August 17, 2025 07:34
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.

1 participant