dprint / dprint-plugin-typescript

TypeScript and JavaScript code formatting plugin for dprint.
https://dprint.dev/plugins/typescript
MIT License
248 stars 50 forks source link

feat: add parenExpression.spaceAround #607

Closed Thristhart closed 4 months ago

Thristhart commented 5 months ago

This adds spaces around the contents of parenthesis expressions. Examples:

// "parenExpression.spaceAround": false
(x.test as unknown) = 6;
// "parenExpression.spaceAround": true
( x.test as unknown ) = 6;

// "parenExpression.spaceAround": false
({ prop: 5 }).prop;
// "parenExpression.spaceAround": true
( { prop: 5 } ).prop;

// "parenExpression.spaceAround": false
const c = (1 + 1) + 1;
// "parenExpression.spaceAround": true
const c = ( 1 + 1 ) + 1;
dsherret commented 4 months ago

Thanks!