Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint for JSX file extension #9436

Conversation

maximemulder
Copy link
Contributor

@maximemulder maximemulder commented Oct 29, 2024

Add a lint to ensure JSX only appears in *.jsx and *.tsx files, helping to differentiate React files and standard script files. The files were automatically renamed based on the errors generated, Javascript files that do not contain JSX are still named *.js.

@maximemulder maximemulder changed the title lint jsx file extension Lint for JSX file extension Oct 29, 2024
@maximemulder maximemulder force-pushed the 2024-10-29_lint-jsx-file-extension branch 4 times, most recently from 8ef3da0 to 43df3f7 Compare October 31, 2024 14:06
@maximemulder maximemulder added the Language: Javascript PR or issue that update Javascript code label Nov 6, 2024
@maximemulder maximemulder force-pushed the 2024-10-29_lint-jsx-file-extension branch from 43df3f7 to 673fc22 Compare November 6, 2024 17:39
@driusan
Copy link
Collaborator

driusan commented Nov 6, 2024

Is there any reason you did this? There isn't a single file with the .jsx extension in LORIS right now. This will cause conflicts with every single javascript PR and seems to be purely cosmetic.

@maximemulder
Copy link
Contributor Author

@driusan I think the change is more than cosmetic. First, it helps to differentiate React files from non-React Javascript files (especially since I'd like to merge the js and jsx directories in the future, even if we do not apply the "compile all in one directory" change). Second, it seems to be a community standard, I rarely see code outside of LORIS using .js for JSX. And finally, it does help some tools better analyze the Javascript code (I notably made this change because during my tests, Vite did not work out of the box with JSX in .js files).

@maximemulder maximemulder force-pushed the 2024-10-29_lint-jsx-file-extension branch from 673fc22 to be397b7 Compare November 8, 2024 16:15
@maximemulder
Copy link
Contributor Author

Too hard breaking and too little benefit for how controversial it is. Closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: Javascript PR or issue that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants