Skip to content

Conversation

@andeplane
Copy link
Owner

Enable Biome linting and enforce unused variables as errors.

This PR replaces the existing linting setup with Biome, adds lint and lint:fix scripts, and configures Biome to treat unused variables as errors.


Open in Cursor Open in Web

Co-authored-by: anders.hafreager <anders.hafreager@cognite.com>
@cursor
Copy link

cursor bot commented Dec 7, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @andeplane, 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 transitions the project's linting infrastructure to Biome, a modern code formatter and linter. The primary goal is to enhance code quality and maintainability by enforcing stricter rules, particularly by treating unused variables as errors, and providing streamlined commands for linting and automatic code fixes.

Highlights

  • Biome Integration: The existing linting setup has been replaced with Biome, a modern code formatter and linter.
  • Strict Linting Rules: Biome is configured to enforce stricter code quality by treating unused variables as errors.
  • New NPM Scripts: Convenience scripts lint and lint:fix have been added to package.json for easy execution of Biome checks and automatic fixes.
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 introduces Biome for linting and formatting, which is a great step towards improving code quality and consistency. The configuration in biome.json is a good start. I've made a couple of suggestions to refine it: one to make the file inclusion patterns more specific for better performance, and another to align the linting rules with the 'strict' goal mentioned in the pull request title. The changes to package.json and package-lock.json look correct.

Comment on lines +8 to +11
"files": {
"ignoreUnknown": false,
"includes": ["**"]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While vcs.useIgnoreFile is helpful, specifying includes more explicitly is a best practice. Using "**" can be slow as it traverses all directories, which might include build artifacts or other files that are not in .gitignore but are not meant to be linted. Scoping it down to your source files will improve performance and prevent unintended linting.

Suggested change
"files": {
"ignoreUnknown": false,
"includes": ["**"]
},
"files": {
"ignoreUnknown": false,
"includes": ["src/**/*.{ts,tsx,js,jsx}"]
},

Comment on lines +22 to +25
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The PR title mentions enabling 'strict' linting, but the configuration only uses the recommended rules. Biome offers a strict preset which enables more opinionated rules for higher code quality. If the intention is to be strict, you could replace "recommended": true with "strict": true.

This would enable all strict rules and keep your override for unused variables. If you only intended to enable the recommended rules, consider updating the PR title to avoid confusion.

Suggested change
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
}
"strict": true,
"correctness": {
"noUnusedVariables": "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.

3 participants