You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The React code .jsx & .tsx in Github repo are recognized as javascript & typescript.
But the languages plugin recognize them as JavaScript & TSX respectively, see my generated-svg :
I suppose that the mapping rule is{ jsx: javascript, tsx: typescript }or{ jsx: jsx, tsx: tsx }(both is ok and of course the first one which is as same as github is better), but the { jsx: javascript, tsx: tsx } is ugly.
Custom languages name tsx:typescript seems not a sustainable way, the typescript language itself has held a place.
Is that a potential bug?
I had conducted a test yesterday and got something unexpected:
In my this repo, i first commit this 300 lines file as a .jsx file deliberately (although it is a .tsx file in fact).
After rerunning my generating workflow, the number of JavaScript lines in most used languages changed from 3.7k to 4.0k, which indicating the .jsx code is recognized as javascript.
But later I pushed a new commit changing the Globe.jsx to Globe.tsx, but now the JavaScript lines remain 4.0k ( I suppose the JavaScript lines should have gone back 3.7k and the TSX lines get that 0.3k; In the same time I did not commit any new js or jsx code in any repo )
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The React code
.jsx
&.tsx
in Github repo are recognized asjavascript
&typescript
.But the languages plugin recognize them as JavaScript & TSX respectively, see my generated-svg :
I suppose that the mapping rule is
{ jsx: javascript, tsx: typescript }
or{ jsx: jsx, tsx: tsx }
(both is ok and of course the first one which is as same as github is better), but the{ jsx: javascript, tsx: tsx }
is ugly.Custom languages name
tsx:typescript
seems not a sustainable way, the typescript language itself has held a place.Is that a potential bug?
I had conducted a test yesterday and got something unexpected:
In my this repo, i first commit this 300 lines file as a
.jsx
file deliberately (although it is a.tsx
file in fact).After rerunning my generating workflow, the number of JavaScript lines in most used languages changed from 3.7k to 4.0k, which indicating the
.jsx
code is recognized as javascript.But later I pushed a new commit changing the
Globe.jsx
toGlobe.tsx
, but now the JavaScript lines remain 4.0k ( I suppose the JavaScript lines should have gone back 3.7k and the TSX lines get that 0.3k; In the same time I did not commit any new js or jsx code in any repo )Hope this additional info would help : )
Beta Was this translation helpful? Give feedback.
All reactions