{"library":"prettier-no-jsx-parens","title":"prettier-no-jsx-parens","description":"A fork of Prettier that removes unnecessary parentheses around JSX fragments and elements, providing a cleaner output for JSX/TSX code. Version 3.4.0 is based on Prettier v3.4.0 and is released infrequently, tracking upstream Prettier versions. It aims to address the common complaint of Prettier adding extra parentheses in JSX, resulting in more compact formatting similar to standard React patterns. Unlike Prettier plugins that modify behavior through options, this is a complete fork that replaces the prettier binary, so it cannot be used as a plugin alongside official Prettier.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-no-jsx-parens"],"cli":{"name":"prettier","version":null}},"imports":["import { format } from 'prettier-no-jsx-parens'","import { resolveConfig } from 'prettier-no-jsx-parens'","import prettier from 'prettier-no-jsx-parens'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install --save-dev prettier-no-jsx-parens\n\n# In package.json scripts:\n{\n  \"scripts\": {\n    \"fmt\": \"prettier-no-jsx-parens --write .\"\n  }\n}\n\n# Usage:\nimport { format } from 'prettier-no-jsx-parens';\n\nconst code = `function Comp() { return (<><span>Hi</span></>); }`;\nconst formatted = await format(code, { parser: 'babel' });\nconsole.log(formatted);\n// Output:\n// function Comp() {\n//   return <>\n//     <span>Hi</span>\n//   </>;\n// }\n","lang":"typescript","description":"Installs the package, adds a formatting script, and shows how to use the API to format JSX without extra parentheses.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}