`jsx-filename-extension`: Include allowed extensions in message #4043

Merged
aduth opened 5:38am on October 7, 2026 wanted to merge 1 commit into jsx-eslint/eslint-plugin-react master from
jsx-filename-extension-allowed-message

Pull Request Overview

  • Opened on October 7, 2026
  • Status Merged
  • Commit count 1 with first commit October 7, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 11 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 1 commit before pull request opened for review
 
0.4 days Awaiting first review
Set up deploy tracking to begin tracking full PR start-to-deploy times

Total time for pull request 0.4 business days from first commit authored to merge
Deploy tracking has not been set up

Author avatar

`jsx-filename-extension`: Include allowed extensions in message

What: Updates jsx-filename-extension rule to include the allowed extensions as part of its message.

Why: So that the message is clearly actionable in instructing what needs to be done to resolve the error.

As additional context, we've configured this rule in our project to allow only .tsx file extensions, as part of our effort to adopt TypeScript consistently in our code. However, this has caused some confusion for contributors who run into lint error messages "JSX not allowed in files with extension '.jsx'", which is confusing both in (a) the counter-intuitiveness of a message describing how JSX is not allowed in a JSX file, and (b) the lack of clear instructions on how to resolve the error. By including the permitted extensions, it would contextualize expectations around how JSX is used and give the contributor (or their AI agent) clear instructions on how to fix the issue.

Disclosure: The code was authored by my Claude Opus 5.5 AI agent, reviewed afterward by myself. I was not able to run the tests locally due to one of the dependencies being flagged as malicious during install.

Comments Threads Pending Resolution

ljharb reviewed on October 7, 2026
ljharb reviewed and approved this work on October 7, 2026
ljharb left a comment

Thanks! Only nit is to wrap in backticks instead of quotes :-)

Resolved Comment Threads

ljharb reviewed and approved this work on October 7, 2026
ljharb left a comment

Thanks! Only nit is to wrap in backticks instead of quotes :-)