## ๐ Bug Report Prettier when using the CLI tool doesn't match when I just run prettier `2.8.8`. ## To Reproduce When I run with these configuration options: ```json { "typescript": true, "titleProp": true, "outDir": "src/components/SVG" } ``` _titleProp causes the interface to be added, which is where the issue is._ and this Prettier config `.prettierrc` ```json { "endOfLine": "auto", "semi": false, "trailingComma": "es5" } ``` I get this... ```typescript import * as React from "react" import type { SVGProps } from "react" interface SVGRProps { title?: string; titleId?: string; } const SvgSample = ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => ( <svg width={100} height={100} aria-labelledby={titleId} {...props}> {title ? <title id={titleId}>{title}</title> : null} <path fill="red" d="M0 0h100v100H0z" /> </svg> ) export default SvgSample ``` Which has semicolons in the interface when it shouldn't. If I run prettier directly, I get this. ```typescript import * as React from "react" import type { SVGProps } from "react" interface SVGRProps { title?: string titleId?: string } const SvgSample = ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => ( <svg width={100} height={100} aria-labelledby={titleId} {...props}> {title ? <title id={titleId}>{title}</title> : null} <path fill="red" d="M0 0h100v100H0z" /> </svg> ) export default SvgSample ``` And if I disable prettier I get this: ```typescript import * as React from "react"; import type { SVGProps } from "react"; interface SVGRProps { title?: string; titleId?: string; } const SvgSample = ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => <svg width={100} height={100} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fill="red" d="M0 0h100v100H0z" /></svg>; export default SvgSample; ``` So, it is loading the prettier config, but it for some reason applies it differently. ## Run `npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard` Paste the results here: ```bash ## System: - OS: macOS 13.5.2 - CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz - Memory: 82.23 MB / 32.00 GB - Shell: 5.9 - /bin/zsh ## Binaries: - Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node - Yarn: 1.22.11 - ~/.nvm/versions/node/v16.17.0/bin/yarn - npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm - Watchman: 2022.10.03.00 - /usr/local/bin/watchman ## npmPackages: - @svgr/cli: ^8.1.0 => 8.1.0 - @svgr/rollup: ^8.0.1 => 8.0.1 ``` ## Workaround I can run prettier directly and that seems OK for now, but curious if this is a limitation. Thanks! ## Notes I edited this after realizing it was reading the prettier configuration.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by damontgomery and has received 0 comments.