@tsrx/prettier-plugin 0.3.61 → 0.3.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsrx/prettier-plugin",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "description": "Ripple plugin for Prettier",
5
5
  "type": "module",
6
6
  "module": "src/index.js",
package/src/index.js CHANGED
@@ -4296,6 +4296,10 @@ function printTSTypeAliasDeclaration(node, path, options, print) {
4296
4296
  head.push(path.call(print, 'typeParameters'));
4297
4297
  }
4298
4298
 
4299
+ if (node.typeAnnotation.type === 'TSTypeLiteral') {
4300
+ return group([head, ' = ', path.call(print, 'typeAnnotation'), semi(options)]);
4301
+ }
4302
+
4299
4303
  return group([head, ' =', indent([line, path.call(print, 'typeAnnotation')]), semi(options)]);
4300
4304
  }
4301
4305
 
package/src/index.test.js CHANGED
@@ -3607,6 +3607,17 @@ second"</pre>
3607
3607
  expect(result).toBeWithNewline(expected);
3608
3608
  });
3609
3609
 
3610
+ it('should not overindent multiline object type aliases', async () => {
3611
+ const input = `type ModuleShape = {
3612
+ default: ComponentType<{ value: string }>;
3613
+ }`;
3614
+ const expected = `type ModuleShape = {
3615
+ default: ComponentType<{ value: string }>;
3616
+ };`;
3617
+ const result = await format(input);
3618
+ expect(result).toBeWithNewline(expected);
3619
+ });
3620
+
3610
3621
  it('should format TypeScript tuple types (TSTupleType)', async () => {
3611
3622
  const input = `type T = [string, number, boolean];`;
3612
3623
  const expected = `type T = [string, number, boolean];`;