Skip to content

feat(forge): allow uppercase abbreviations in mixed-case-variable lint #12741

@nuul-dev

Description

@nuul-dev

Component

Forge

Describe the feature you would like

The mixed-case-variable lint rule currently flags variables like marketID, optionID, userID as violations, suggesting they should use mixedCase.

However, keeping common abbreviations in uppercase (ID, URL, URI, API, etc.) is a widely accepted convention in camelCase/mixedCase naming. Writing marketId incorrectly suggests "Id" is a word rather than an abbreviation for "Identifier".
Proposed solution:
Add an exception list for common abbreviations that should remain uppercase when appearing at the end or middle of an identifier:

  • ID
  • URL
  • URI
  • API
  • JSON, XML, HTML, HTTP, HTTPS

Additional context

Current lint output example:

note[mixed-case-variable]: mutable variables should use mixedCase
  --> src/FPMMRouterV2.sol:35:11
   |
35 |         uint256 marketID,
   |         --------

This creates noise in lint output for codebases following the uppercase abbreviation convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions