Skip to content

Conversation

@loderunner
Copy link

@loderunner loderunner commented Nov 19, 2025

Fixes: #3175 #3639 #3193

Warning

I had to pin the ESLint version in the published types test project, as the ESLint types break with TypeScript 4.0 starting with ESLint 9.39.0. This can also be fixed by dropping support for TypeScript 4.0.

Let me know if I should remove 4.0 from the matrix instead.

Adds a sortFirst option to enforce that specified props appear first, in the given order. Takes precedence over other sorting options (reservedFirst, shorthandFirst, callbacksLast, multiline).

Examples:

// Configuration: { sortFirst: ['className', 'id'] }

// ❌ Incorrect
<Hello name="John" className="test" id="test" />

<Hello id="test" className="test" />

// ✅ Correct
<Hello className="test" id="test" name="John" />
// Configuration: { sortFirst: ['className'], ignoreCase: true }

// ❌ Incorrect  
<Hello name="John" classname="test" />

// ✅ Correct
<Hello classname="test" name="John" />

Props in sortFirst maintain their specified order relative to each other, and all appear before other props.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (f2869fd) to head (cc1c24c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3965   +/-   ##
=======================================
  Coverage   97.84%   97.84%           
=======================================
  Files         136      136           
  Lines       10008    10041   +33     
  Branches     3717     3732   +15     
=======================================
+ Hits         9792     9825   +33     
  Misses        216      216           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loderunner loderunner marked this pull request as draft November 20, 2025 09:22
@loderunner
Copy link
Author

Converting to draft PR while I address the CI issues.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedeslint@​9.38.09710010097100

View full report

@loderunner loderunner marked this pull request as ready for review November 20, 2025 09:44
@loderunner
Copy link
Author

Just realized this is likely a duplicate of #3853, opened almost exactly one year ago. 😅

@mesqueeb
Copy link

@ljharb Given the other PR #3853 is abandoned, can we move ahead with this one? 👼🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[jsx-sort-props] consider className as reserved props

2 participants