depercolator
depercolator copied to clipboard
detect jsx code in *.coffee file and convert to *.jsx file
Expected behavior
when jsx code is present in a *.coffee file (yes it should be a *.cjsx file) depercolate should write a *.jsx file
Observed behavior
*.coffee -> *.js
*.cjsx -> *.jsx
Steps to reproduce
depercolate file.coffee
the output is valid jsx code, just the file extension is wrong
file.coffee:
f = () ->
<br/>
file.js (should be file.jsx):
const f = () => <br />;
Version
$ pnpm list -g depercolator
depercolator 0.5.0
Quickfix
node --check file.js || mv file.js file.jsx