`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
Diff Delta:
0
Classified as:  General

aduth's Description of Work

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.

0 total changed files
You’ve reached the end
Reviewer: 1. Additional work: 0