Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 20, 2025

Pull request

Description

Extracted React-specific linting rules from base.json into a new react.json config. Base config is now framework-agnostic.

Changes:

  • Created react.json - Contains useHookAtTopLevel, noUselessFragments, noLeakedRender, noDuplicatedSpreadProps, and JSX/TSX overrides for noImplicitBoolean
  • Updated base.json - Removed all React-specific rules
  • Updated nestjs.json & solidjs.json - Removed unnecessary useHookAtTopLevel: "off" overrides
  • Updated package.json - Added ./react export
  • Updated README.md - Added React config documentation with usage examples

Usage:

// React project
{
  "extends": [
    "@tutods/biome-config",
    "@tutods/biome-config/react"
  ]
}

// Next.js project
{
  "extends": [
    "@tutods/biome-config",
    "@tutods/biome-config/react",
    "@tutods/biome-config/nextjs"
  ]
}

// NestJS project (no React rules)
{
  "extends": [
    "@tutods/biome-config",
    "@tutods/biome-config/nestjs"
  ]
}

Motivation and Context

Base config included React-specific rules, forcing non-React projects (NestJS, SolidJS) to explicitly disable them. This creates redundancy and violates separation of concerns.

References

N/A

Types of changes

  • Breaking change (a fix or feature that would cause existing functionality to change)
  • Bugfix (a non-breaking change that fixes an issue)
  • Chore (a task that doesn't add or fix existing code or tests)
  • New feature (a non-breaking change that adds functionality)
  • Performance (a non-breaking change that reduces time or space complexity of a flow)
  • Refactor (a non-breaking change that restructures existing code)
  • Test (added or updated existing tests without implementation changes)
Original prompt

This section details on the original issue you should resolve

<issue_title>Split React-specific rules out of base.json config and reorganize config structure</issue_title>
<issue_description>### Problem
Currently, base.json includes both common and React-specific rules. This creates confusion and forces non-React projects to inherit React-specific linting rules, requiring other configs to explicitly disable them.

Current Issues in Code

In configs/biome-config/base. json:

"correctness": {
  "recommended": true,
  "useHookAtTopLevel": "error",  // React-specific rule
  // ... other rules
}

Framework configs disabling React rules:

nestjs.json:

"correctness": {
  "useHookAtTopLevel": "off"  // Disabling React rule
}

solidjs.json:

"correctness": {
  "useHookAtTopLevel": "off"  // Disabling React rule
}

Proposal

  1. Split base.json:

    • Move React-specific rules (useHookAtTopLevel, etc.) out of base.json
    • Keep only framework-agnostic rules in base config
  2. Create react.json:

    • New config file containing React-specific linting rules
    • Should extend base. json and add React-specific rules
  3. Update existing configs:

    • Remove rule disabling from nestjs.json and solidjs.json
    • Update nextjs.json to properly extend both base and React configs
    • Update documentation and package.json exports

Motivation

  • Cleaner separation: Base config should be truly framework-agnostic
  • Reduced redundancy: No need to disable React rules in non-React projects
  • Better composition: Users can combine base + React as needed
  • Improved maintainability: Changes to React rules only affect React config

Acceptance Criteria

  • base.json contains only generic (non-React) rules
  • New react.json contains React-specific rules (like useHookAtTopLevel)
  • nestjs.json and solidjs.json no longer disable React rules
  • nextjs.json properly extends base and React configs
  • Package.json exports updated to include ./react
  • Documentation updated with new React config usage examples
  • All existing functionality preserved

Files to be modified:

  • configs/biome-config/base.json
  • configs/biome-config/nestjs.json
  • configs/biome-config/solidjs.json
  • configs/biome-config/nextjs.json
  • configs/biome-config/package.json
  • configs/biome-config/README.md

New file to create:

  • configs/biome-config/react.json</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 20, 2025 18:41
…on config

Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
Copilot AI changed the title [WIP] Split React-specific rules out of base.json config feat(biome-config): split React-specific rules into separate react.json config Dec 20, 2025
Copilot AI requested a review from tutods December 20, 2025 18:44
@tutods tutods marked this pull request as ready for review December 20, 2025 23:08
Copilot AI review requested due to automatic review settings December 20, 2025 23:08
@tutods tutods merged commit f64bc06 into main Dec 20, 2025
6 checks passed
@tutods tutods deleted the copilot/split-react-rules-from-base branch December 20, 2025 23:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR successfully extracts React-specific linting rules from the base configuration into a separate react.json file, making the base config truly framework-agnostic. This improves separation of concerns and eliminates the need for non-React projects to explicitly disable React rules.

Key changes:

  • Created new react.json with React-specific rules (useHookAtTopLevel, noUselessFragments, noLeakedRender, noDuplicatedSpreadProps, and JSX/TSX overrides)
  • Cleaned up base.json by removing all React-specific rules and overrides
  • Updated solidjs.json to remove unnecessary useHookAtTopLevel override

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
configs/biome-config/react.json New config file containing React-specific linting rules and JSX/TSX overrides
configs/biome-config/base.json Removed React-specific rules to make config framework-agnostic
configs/biome-config/solidjs.json Removed unnecessary React rule override
configs/biome-config/nestjs.json Removed unnecessary React rule override
configs/biome-config/package.json Added ./react export path
configs/biome-config/README.md Updated documentation with React config usage examples and descriptions
Comments suppressed due to low confidence (1)

configs/biome-config/nestjs.json:26

  • The NestJS config still explicitly disables React-specific rules (noUselessFragments, noLeakedRender, noDuplicatedSpreadProps) that have been moved to react.json. Since these rules are no longer in base.json, these overrides are unnecessary and should be removed as part of this refactoring to maintain consistency with the PR's goal of eliminating React rule references from non-React configs.
        "noUselessFragments": "off"
      },
      "style": {
        "useImportType": "off"
      },
      "a11y": {
        "recommended": false
      },
      "nursery": {
        "noLeakedRender": "off",
        "noDuplicatedSpreadProps": "off",
        "noAmbiguousAnchorText": "off",
        "useSortedClasses": "off"
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- **`base.json`**: stores the basic/global configuration with comprehensive linting rules for JavaScript/TypeScript projects;
- **`base.json`**: stores the basic/global configuration with comprehensive linting rules for JavaScript/TypeScript projects (framework-agnostic);
- **`react.json`**: extends base configuration with React-specific linting rules (hooks, fragments, etc.);
- **`nestjs.jsonc`:** extends base configuration for **Nest.js** projects (allowing decorators, etc.);
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The file extension reference is inconsistent with the actual file. The text says "nestjs.jsonc" but the actual file is "nestjs.json" (without the 'c'). This should be corrected to match the actual filename.

Suggested change
- **`nestjs.jsonc`:** extends base configuration for **Nest.js** projects (allowing decorators, etc.);
- **`nestjs.json`:** extends base configuration for **Nest.js** projects (allowing decorators, etc.);

Copilot uses AI. Check for mistakes.
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.

Split React-specific rules out of base.json config and reorganize config structure

2 participants