[Babel 6 Plugin] transform react jsx code to json schema
npm i babel-plugin-jsx-to-schema -S
const path = require('path');
const fs = require('fs');
const babel = require('babel-core');
const jsxToSchemaPlugin = require('babel-plugin-jsx-to-schema');
const code = fs.readFileSync(path.join('./', 'code.js'));
const result = babel.transform(code, {
plugins: [jsxToSchemaPlugin],
});