Skip to content

chore: highlight .rx files as TSX on GitHub - #102

Open
brenelz wants to merge 1 commit into
solidjs:mainfrom
brenelz:rx-linguist-tsx
Open

brenelz wants to merge 1 commit into
solidjs:mainfrom
brenelz:rx-linguist-tsx

Conversation

@brenelz

@brenelz brenelz commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

GitHub shows .rx files as plain text because Linguist doesn't recognize the extension. A request to add ReactiveScript to Linguist is open at github-linguist/linguist#8365, but Linguist only adds a language once it has wide use on GitHub.

Until then, .gitattributes maps *.rx (which also matches .d.rx) to TSX, so the TypeScript and JSX parts are highlighted in file views, diffs and PRs. ReactiveScript keywords such as source, action, component and := still show as plain identifiers. GitHub's language bar will also count .rx files as TSX.

I compared TSX with TSRX, the other close match in Linguist, on about 90 of the repo's .rx files. Each grammar's output was compared with tooling/vscode-rx/syntaxes/rx.tmLanguage.json: TSX matched on 75.0% of characters and TSRX on 72.3%. git check-attr linguist-language -- examples/todo.rx reports TSX.

🤖 Generated with Claude Code

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant