@huggingface/prettier-plugin-vertical-align
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -64,3 +64,3 @@ import prettier from "prettier"; | ||
// console.log("node", inspect(node, {depth: 10})); | ||
const properties = nodeProperties(node).filter((node) => !isProperty(node) | ||
const properties = nodeProperties(node).filter((node) => !isProperty(node) || !node[valueField(node)] | ||
? node.loc.start.line === node.loc.end.line | ||
@@ -78,3 +78,3 @@ : node.key.loc.start.line === node[valueField(node)].loc.start.line); | ||
// Shorthands and methods are not aligned but they do not start a new group | ||
if (isProperty(prop) && !prop.shorthand && !prop.method) { | ||
if (isProperty(prop) && prop[valueField(prop)] && !prop.shorthand && !prop.method) { | ||
groups.at(-1).push(prop); | ||
@@ -81,0 +81,0 @@ } |
{ | ||
"name": "@huggingface/prettier-plugin-vertical-align", | ||
"version": "0.2.0", | ||
"description": "", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "src/index.ts", | ||
"files": [ | ||
"src", | ||
"dist", | ||
"tsconfig.json" | ||
], | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.6.2", | ||
"@types/node": "^22.0.0" | ||
}, | ||
"scripts": { | ||
"test": "pnpm -w test", | ||
"build": "tsc -b" | ||
} | ||
} | ||
"name": "@huggingface/prettier-plugin-vertical-align", | ||
"packageManager": "pnpm@9.11.0", | ||
"version": "0.2.1", | ||
"description": "", | ||
"scripts": { | ||
"test": "pnpm -w test", | ||
"build": "tsc -b", | ||
"prepublishOnly": "npm run build && npm run test" | ||
}, | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "src/index.ts", | ||
"files": [ | ||
"src", | ||
"dist", | ||
"tsconfig.json" | ||
], | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.6.2", | ||
"@types/node": "^22.0.0" | ||
} | ||
} |
@@ -82,3 +82,3 @@ import type { AstPath, Printer } from "prettier"; | ||
const properties: Node[] = nodeProperties(node).filter((node: Node) => | ||
!isProperty(node) | ||
!isProperty(node) || !node[valueField(node)] | ||
? node.loc.start.line === node.loc.end.line | ||
@@ -99,3 +99,3 @@ : node.key.loc.start.line === node[valueField(node)].loc.start.line, | ||
// Shorthands and methods are not aligned but they do not start a new group | ||
if (isProperty(prop) && !prop.shorthand && !prop.method) { | ||
if (isProperty(prop) && prop[valueField(prop)] && !prop.shorthand && !prop.method) { | ||
groups.at(-1)!.push(prop); | ||
@@ -102,0 +102,0 @@ } |
Sorry, the diff of this file is not supported yet
48608