Back to all reviewers

Configuration precision matters

vercel/turborepo
Based on 4 comments
Json

Ensure configuration files are precise and stable to prevent unexpected build failures and runtime issues. This includes: 1. **Use correct syntax in configuration files**

Configurations Json

Reviewer Prompt

Ensure configuration files are precise and stable to prevent unexpected build failures and runtime issues. This includes:

  1. Use correct syntax in configuration files Validate JSON files for syntax errors like extra commas, which can cause cryptic error messages during builds.

    // Incorrect
    {
      "$schema": "https://turborepo.com/schema.json",,
      "ui": "tui"
    }
       
    // Correct
    {
      "$schema": "https://turborepo.com/schema.json",
      "ui": "tui"
    }
    
  2. Specify exact versions for critical dependencies Use exact versions instead of ranges (^ or ~) for dependencies when stability is critical, especially in test fixtures or shared packages.

    // Less stable (allows minor updates)
    "dependencies": {
      "@types/d3-scale": "^4.0.2"
    }
       
    // More stable (locks exact version)
    "dependencies": {
      "@types/d3-scale": "4.0.2"
    }
    
  3. Explicitly specify package manager Include the packageManager field in package.json to ensure consistent behavior across environments, especially when using version wildcards (*).

    {
      "name": "monorepo",
      "packageManager": "pnpm@8.14.0",
      "dependencies": {
        "util": "*"
      }
    }
    
  4. Establish clear sources of truth Define which configuration files are authoritative for specific settings. For example, make package.json’s engines field the definitive source for Node.js version requirements.

    "engines": {
      "node": "22.x"
    }
    

These practices reduce configuration drift, prevent unexpected behavior, and help maintain consistency across environments and team members.

4
Comments Analyzed
Json
Primary Language
Configurations
Category

Source Discussions