@@ -9,7 +9,7 @@ exports[`cli should not override config with cli defaults 1`] = `
99"import * as React from \\ "react\\ ";
1010
1111function SvgFile() {
12- return <svg viewBox =\\"0 0 48 1\\"><title>{\\"Rectangle 5\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id =\\"Page-1\\" stroke =\\"none\\" strokeWidth = { 1 } fill =\\"none\\" fillRule =\\"evenodd\\"><g id =\\"19-Separator\\" transform =\\"translate(-129.000000, -156.000000)\\" fill =\\"#063855\\"><g id =\\"Controls/Settings\\" transform =\\"translate(80.000000, 0.000000)\\"><g id =\\"Content\\" transform =\\"translate(0.000000, 64.000000)\\"><g id =\\"Group\\" transform =\\"translate(24.000000, 56.000000)\\"><g id =\\"Group-2\\"><rect id =\\"Rectangle-5\\" x = { 25 } y = { 36 } width = { 48 } height = { 1 } />< / g></ g >< / g></ g >< / g></ g >< / svg > ;
12+ return <svg viewBox =\\"0 0 48 1\\" xmlns =\\"http://www.w3.org/2000/svg\\" xmlnsXlink =\\"http://www.w3.org/1999/xlink\\" ><title>{\\"Rectangle 5\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id =\\"Page-1\\" stroke =\\"none\\" strokeWidth = { 1 } fill =\\"none\\" fillRule =\\"evenodd\\"><g id =\\"19-Separator\\" transform =\\"translate(-129.000000, -156.000000)\\" fill =\\"#063855\\"><g id =\\"Controls/Settings\\" transform =\\"translate(80.000000, 0.000000)\\"><g id =\\"Content\\" transform =\\"translate(0.000000, 64.000000)\\"><g id =\\"Group\\" transform =\\"translate(24.000000, 56.000000)\\"><g id =\\"Group-2\\"><rect id =\\"Rectangle-5\\" x = { 25 } y = { 36 } width = { 48 } height = { 1 } />< / g></ g >< / g></ g >< / g></ g >< / svg > ;
1313}
1414
1515export default SvgFile;
@@ -23,7 +23,12 @@ exports[`cli should support --prettier-config as file 1`] = `
2323
2424function SvgFile(props) {
2525 return (
26- <svg width = { 48 } height = { 1 } { ... props } >
26+ <svg
27+ width = { 48 }
28+ height = { 1 }
29+ xmlns =\\"http://www.w3.org/2000/svg\\"
30+ { ... props }
31+ >
2732 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
2833 </svg >
2934 )
@@ -39,7 +44,12 @@ exports[`cli should support --prettier-config as json 1`] = `
3944
4045function SvgFile(props) {
4146 return (
42- <svg width = { 48 } height = { 1 } { ... props } >
47+ <svg
48+ width = { 48 }
49+ height = { 1 }
50+ xmlns =\\"http://www.w3.org/2000/svg\\"
51+ { ... props }
52+ >
4353 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
4454 </svg >
4555 )
@@ -55,7 +65,7 @@ exports[`cli should support --svgo-config as file 1`] = `
5565
5666function SvgFile(props) {
5767 return (
58- <svg width = { 48 } height = { 1 } { ... props } >
68+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
5969 <title >{ ' Rectangle 5' } </title >
6070 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
6171 </svg >
@@ -72,7 +82,7 @@ exports[`cli should support --svgo-config as json 1`] = `
7282
7383function SvgFile(props) {
7484 return (
75- <svg width = { 48 } height = { 1 } { ... props } >
85+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
7686 <title >{ ' Rectangle 5' } </title >
7787 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
7888 </svg >
@@ -138,7 +148,7 @@ exports[`cli should support stdin filepath 1`] = `
138148
139149function SvgFile(props) {
140150 return (
141- <svg width = { 48 } height = { 1 } { ... props } >
151+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
142152 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
143153 </svg >
144154 )
@@ -154,7 +164,7 @@ exports[`cli should support various args: --expand-props none 1`] = `
154164
155165function SvgFile() {
156166 return (
157- <svg width = { 48 } height = { 1 } >
167+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
158168 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
159169 < / svg >
160170 )
@@ -170,7 +180,7 @@ exports[`cli should support various args: --expand-props start 1`] = `
170180
171181function SvgFile(props) {
172182 return (
173- <svg { ... props } width = { 48 } height = { 1 } >
183+ <svg { ... props } width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
174184 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
175185 < / svg >
176186 )
@@ -186,7 +196,13 @@ exports[`cli should support various args: --icon 1`] = `
186196
187197function SvgFile(props) {
188198 return (
189- <svg width =\\"1em\\" height =\\"1em\\" viewBox =\\"0 0 48 1\\" { ... props } >
199+ <svg
200+ width =\\"1em\\"
201+ height =\\"1em\\"
202+ viewBox =\\"0 0 48 1\\"
203+ xmlns =\\"http://www.w3.org/2000/svg\\"
204+ { ... props }
205+ >
190206 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
191207 </svg >
192208 )
@@ -203,7 +219,7 @@ import Svg, { Path } from 'react-native-svg'
203219
204220function SvgFile() {
205221 return (
206- <Svg width = { 48 } height = { 1 } >
222+ <Svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
207223 <Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
208224 < / Svg >
209225 )
@@ -220,7 +236,13 @@ import Svg, { Path } from 'react-native-svg'
220236
221237function SvgFile(props) {
222238 return (
223- <Svg width =\\"1em\\" height =\\"1em\\" viewBox =\\"0 0 48 1\\" { ... props } >
239+ <Svg
240+ width =\\"1em\\"
241+ height =\\"1em\\"
242+ viewBox =\\"0 0 48 1\\"
243+ xmlns =\\"http://www.w3.org/2000/svg\\"
244+ { ... props }
245+ >
224246 <Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
225247 </Svg >
226248 )
@@ -237,7 +259,13 @@ import Svg, { Path } from 'react-native-svg'
237259
238260function SvgFile(props, svgRef) {
239261 return (
240- <Svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
262+ <Svg
263+ width = { 48 }
264+ height = { 1 }
265+ xmlns =\\"http://www.w3.org/2000/svg\\"
266+ ref = { svgRef }
267+ { ... props }
268+ >
241269 <Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
242270 </Svg >
243271 )
@@ -255,7 +283,7 @@ import Svg, { Path } from 'react-native-svg'
255283
256284function SvgFile(props) {
257285 return (
258- <Svg width = { 48 } height = { 1 } { ... props } >
286+ <Svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
259287 <Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
260288 </Svg >
261289 )
@@ -271,7 +299,7 @@ exports[`cli should support various args: --no-dimensions 1`] = `
271299
272300function SvgFile(props) {
273301 return (
274- <svg viewBox =\\"0 0 48 1\\" { ... props } >
302+ <svg viewBox =\\"0 0 48 1\\" xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
275303 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
276304 </svg >
277305 )
@@ -286,7 +314,7 @@ exports[`cli should support various args: --no-prettier 1`] = `
286314"import * as React from \\ "react\\ ";
287315
288316function SvgFile(props) {
289- return <svg width = { 48 } height = { 1 } { ... props } ><path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" /></svg >;
317+ return <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } ><path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" /></svg >;
290318}
291319
292320export default SvgFile;
@@ -298,7 +326,14 @@ exports[`cli should support various args: --no-svgo 1`] = `
298326
299327function SvgFile(props) {
300328 return (
301- <svg width =\\"48px\\" height =\\"1px\\" viewBox =\\"0 0 48 1\\" { ... props } >
329+ <svg
330+ width =\\"48px\\"
331+ height =\\"1px\\"
332+ viewBox =\\"0 0 48 1\\"
333+ xmlns =\\"http://www.w3.org/2000/svg\\"
334+ xmlnsXlink =\\"http://www.w3.org/1999/xlink\\"
335+ { ... props }
336+ >
302337 <title >{ ' Rectangle 5' } </title >
303338 <desc >{ ' Created with Sketch.' } </desc >
304339 <defs />
@@ -339,7 +374,13 @@ exports[`cli should support various args: --ref 1`] = `
339374
340375function SvgFile(props, svgRef) {
341376 return (
342- <svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
377+ <svg
378+ width = { 48 }
379+ height = { 1 }
380+ xmlns =\\"http://www.w3.org/2000/svg\\"
381+ ref = { svgRef }
382+ { ... props }
383+ >
343384 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
344385 </svg >
345386 )
@@ -356,7 +397,7 @@ exports[`cli should support various args: --replace-attr-values "#063855=current
356397
357398function SvgFile(props) {
358399 return (
359- <svg width = { 48 } height = { 1 } { ... props } >
400+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
360401 <path d =\\"M0 0h48v1H0z\\" fill =\\"currentColor\\" fillRule =\\"evenodd\\" />
361402 </svg >
362403 )
@@ -372,7 +413,14 @@ exports[`cli should support various args: --svg-props "hidden={true},id=hello" 1
372413
373414function SvgFile(props) {
374415 return (
375- <svg width = { 48 } height = { 1 } hidden = { true } id =\\"hello\\" { ... props } >
416+ <svg
417+ width = { 48 }
418+ height = { 1 }
419+ xmlns =\\"http://www.w3.org/2000/svg\\"
420+ hidden = { true }
421+ id =\\"hello\\"
422+ { ... props }
423+ >
376424 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
377425 </svg >
378426 )
@@ -388,7 +436,13 @@ exports[`cli should support various args: --title-prop 1`] = `
388436
389437function SvgFile({ title , titleId , ... props } ) {
390438 return (
391- <svg width = { 48 } height = { 1 } aria-labelledby = { titleId } { ... props } >
439+ <svg
440+ width = { 48 }
441+ height = { 1 }
442+ xmlns =\\"http://www.w3.org/2000/svg\\"
443+ aria-labelledby = { titleId }
444+ { ... props }
445+ >
392446 { title ? <title id = { titleId } >{ title } </title > : null }
393447 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
394448 </svg >
@@ -415,6 +469,7 @@ function SvgFile(
415469 <svg
416470 width = { 48 }
417471 height = { 1 }
472+ xmlns =\\"http://www.w3.org/2000/svg\\"
418473 ref = { svgRef }
419474 aria-labelledby = { titleId }
420475 { ... props }
@@ -439,7 +494,13 @@ function SvgFile(
439494 svgRef?: React.Ref<SVGSVGElement >,
440495) {
441496 return (
442- <svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
497+ <svg
498+ width = { 48 }
499+ height = { 1 }
500+ xmlns =\\"http://www.w3.org/2000/svg\\"
501+ ref = { svgRef }
502+ { ... props }
503+ >
443504 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
444505 </svg >
445506 )
@@ -456,7 +517,7 @@ exports[`cli should support various args: --typescript 1`] = `
456517
457518function SvgFile(props: React.SVGProps<SVGSVGElement >) {
458519 return (
459- <svg width = { 48 } height = { 1 } { ... props } >
520+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
460521 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
461522 </svg >
462523 )
@@ -512,7 +573,7 @@ exports[`cli should work with a simple file 1`] = `
512573
513574function SvgFile(props) {
514575 return (
515- <svg width = { 48 } height = { 1 } { ... props } >
576+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
516577 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
517578 </svg >
518579 )
@@ -528,7 +589,7 @@ exports[`cli should work with stdin 1`] = `
528589
529590function SvgComponent(props) {
530591 return (
531- <svg width = { 48 } height = { 1 } { ... props } >
592+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
532593 <path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
533594 </svg >
534595 )
0 commit comments