insomnia/packages/insomnia-components/svgr.config.js
Dimitri Mitropoulos 5f4c19da35
[TypeScript] Phase 1 & 2 (#3370)
Co-authored-by: Opender Singh <opender.singh@konghq.com>
2021-05-12 18:35:00 +12:00

25 lines
604 B
JavaScript

module.exports = {
// @ts-expect-error -- no types yet exist for svgr
template: ({ template }, options, { componentName, jsx }) => (
template.smart({ plugins: ['jsx', 'typescript'] }).ast`
import React, { SVGProps, memo } from 'react';
export const ${componentName} = memo<SVGProps<SVGSVGElement>>(props => (
${jsx}
));
`),
icon: true,
replaceAttrValues: {
'#000': '',
'#FFF': 'currentColor',
},
ext: 'tsx',
prettier: true,
prettierConfig: {
arrowParens: 'avoid',
singleQuote: true,
parser: 'typescript',
},
typescript: true,
};