@huggingface/prettier-plugin-vertical-align
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -65,3 +65,3 @@ import prettier from "prettier"; | ||
.filter(isProperty) | ||
.filter((node) => node.key.loc.start.line === node.key.loc.end.line && !node.shorthand && !node.method); | ||
.filter((node) => node.key.loc.start.line === node.key.loc.end.line); | ||
for (const prop of properties) { | ||
@@ -77,3 +77,6 @@ const propStart = prop.comments ? prop.comments[0].loc.start.line : prop.loc.start.line; | ||
} | ||
groups.at(-1).push(prop); | ||
// Shorthands and methods are not aligned but they do not start a new group | ||
if (!prop.shorthand && !prop.method) { | ||
groups.at(-1).push(prop); | ||
} | ||
prevLine = prop.key.loc.start.line; | ||
@@ -80,0 +83,0 @@ } |
{ | ||
"name": "@huggingface/prettier-plugin-vertical-align", | ||
"packageManager": "pnpm@9.11.0", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -82,3 +82,3 @@ import type { AstPath, Printer } from "prettier"; | ||
.filter(isProperty) | ||
.filter((node: Node) => node.key.loc.start.line === node.key.loc.end.line && !node.shorthand && !node.method); | ||
.filter((node: Node) => node.key.loc.start.line === node.key.loc.end.line); | ||
@@ -97,4 +97,8 @@ for (const prop of properties) { | ||
} | ||
groups.at(-1)!.push(prop); | ||
// Shorthands and methods are not aligned but they do not start a new group | ||
if (!prop.shorthand && !prop.method) { | ||
groups.at(-1)!.push(prop); | ||
} | ||
prevLine = prop.key.loc.start.line; | ||
@@ -101,0 +105,0 @@ } |
Sorry, the diff of this file is not supported yet
47582
949