fbredius/storybook

View on GitHub
lib/csf-tools/src/babelParse.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { parse } from '@babel/parser';

export const babelParse = (code: string) =>
  parse(code, {
    sourceType: 'module',
    // FIXME: we should get this from the project config somehow?
    plugins: [
      'jsx',
      'typescript',
      ['decorators', { decoratorsBeforeExport: true }],
      'classProperties',
    ],
  });