https://github.com/qpwo/prettier-no-jsx-parens
prettier disable parens around jsx and tsx!
https://github.com/qpwo/prettier-no-jsx-parens
formatter prettier react typescript
Last synced: 8 months ago
JSON representation
prettier disable parens around jsx and tsx!
- Host: GitHub
- URL: https://github.com/qpwo/prettier-no-jsx-parens
- Owner: qpwo
- License: mit
- Created: 2022-05-08T23:02:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-27T21:01:03.000Z (9 months ago)
- Last Synced: 2025-10-02T04:55:44.695Z (9 months ago)
- Topics: formatter, prettier, react, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/prettier-no-jsx-parens
- Size: 110 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# prettier-no-jsx-parens
Prettier without so many parenthesis in jsx/tsx. Not perfect but decent. Seems to work fine with a global or a local install in my testing.
## Example comparison
```jsx
// prettier-no-jsx-parens:
function User({ username }) {
return <>
User:
{username}
>;
}
// regular prettier:
function User({ username }) {
return (
<>
User:
{username}
>
);
}
```
## Installation
```bash
npm i --save-dev prettier-no-jsx-parens
yarn add --dev prettier-no-jsx-parens
```
Then in your `package.json`:
```json
{
"scripts": {
"fmt": "prettier-no-jsx-parens -w -l ."
}
}
```
```bash
echo 'alias prettier="prettier-no-jsx-parens"' >> ~/.bashrc
# or
echo 'alias prettier="prettier-no-jsx-parens"' >> ~/.zshrc
```
## Vscode setting
In your settings.json add
```json
"prettier.prettierPath": "global-or-local-folder/node_modules/prettier-no-jsx-parens/"
```