Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Sep 5, 2021
1 parent ed14425 commit 310ceb6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All work on SVGR happens directly on [GitHub](/). Both core team members and ext

### Online one click Setup

You can use Gitpod(An Online Open Source VS Code like IDE which is free for Open Source) for contributing online. With a single click it will start a workspace and automatically:
You can use Gitpod(An Online Open Source VS Code like IDE which is free for Open Source) for contributing online. With a single click it will start a workspace and automatically:

- clone the `svgr` repo.
- install all the dependencies in `/` and `/website`.
Expand Down
21 changes: 13 additions & 8 deletions packages/babel-plugin-transform-svg-component/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ export const getProps = ({ types: t }, opts) => {
typeParameters([
opts.native
? genericTypeAnnotation(
qualifiedTypeIdentifier(t.identifier('React'), t.identifier('Component')),
typeParameters([genericTypeAnnotation(t.identifier('SvgProps'))]))
qualifiedTypeIdentifier(
t.identifier('React'),
t.identifier('Component'),
),
typeParameters([
genericTypeAnnotation(t.identifier('SvgProps')),
]),
)
: genericTypeAnnotation(t.identifier('SVGSVGElement')),
]),
),
Expand Down Expand Up @@ -182,15 +188,14 @@ export const getImport = ({ types: t }, opts) => {
if (opts.native.expo) {
importDeclarations.push(t.importDeclaration([], t.stringLiteral('expo')))
} else {
const imports = [t.importDefaultSpecifier(t.identifier('Svg'))];
const imports = [t.importDefaultSpecifier(t.identifier('Svg'))]
if (opts.typescript && opts.expandProps) {
imports.push(t.importSpecifier(t.identifier('SvgProps'), t.identifier('SvgProps')));
imports.push(
t.importSpecifier(t.identifier('SvgProps'), t.identifier('SvgProps')),
)
}
importDeclarations.push(
t.importDeclaration(
imports,
t.stringLiteral('react-native-svg'),
),
t.importDeclaration(imports, t.stringLiteral('react-native-svg')),
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ By default, `@svgr/webpack` includes a `babel-loader` with [an optimized configu
It is possible to detect the module that requires your SVG using [`Rule.issuer`](https://webpack.js.org/configuration/module/#ruleissuer) in Webpack 5. Using it you can specify two different configurations for JavaScript and the rest of your files.

```js
[
;[
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.[jt]sx?$/,
use: ['babel-loader', '@svgr/webpack', 'url-loader']
use: ['babel-loader', '@svgr/webpack', 'url-loader'],
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader'
loader: 'url-loader',
},
]
```
Expand Down

0 comments on commit 310ceb6

Please sign in to comment.