@huggingface/prettier-plugin-vertical-align
Advanced tools
Comparing version 0.0.6 to 0.0.7
import prettier from "prettier"; | ||
// import { inspect } from "node:util"; | ||
import { inspect } from "node:util"; | ||
const { doc } = prettier; | ||
@@ -15,5 +15,5 @@ import { getOriginalPrinter } from "./original-printer.js"; | ||
// } | ||
// if (node.type === "Program") { | ||
// console.log("node", inspect(node.body, { depth: 10 })); | ||
// } | ||
if (node.type === "Program") { | ||
console.log("node", inspect(node.body, { depth: 10 })); | ||
} | ||
if (node[keyLengthSymbol]) { | ||
@@ -28,2 +28,3 @@ const keyLength = node[keyLengthSymbol]; | ||
case "Property": | ||
case "ObjectProperty": | ||
return group([ | ||
@@ -85,6 +86,7 @@ node.computed ? "[" : "", | ||
function isProperty(node) { | ||
return node.type === "Property" || node.type === "TSPropertySignature"; | ||
// JS has ObjectProperty, TS has Property | ||
return node.type === "Property" || node.type === "TSPropertySignature" || node.type === "ObjectProperty"; | ||
} | ||
function valueField(node) { | ||
if (node.type === "Property") { | ||
if (node.type === "Property" || node.type === "ObjectProperty") { | ||
return "value"; | ||
@@ -91,0 +93,0 @@ } |
{ | ||
"name": "@huggingface/prettier-plugin-vertical-align", | ||
"packageManager": "pnpm@9.11.0", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -39,2 +39,3 @@ import type { AstPath, Printer } from "prettier"; | ||
case "Property": | ||
case "ObjectProperty": | ||
return group([ | ||
@@ -107,7 +108,8 @@ node.computed ? "[" : "", | ||
function isProperty(node: AstPath["node"]) { | ||
return node.type === "Property" || node.type === "TSPropertySignature"; | ||
// JS has ObjectProperty, TS has Property | ||
return node.type === "Property" || node.type === "TSPropertySignature" || node.type === "ObjectProperty"; | ||
} | ||
function valueField(node: AstPath["node"]) { | ||
if (node.type === "Property") { | ||
if (node.type === "Property" || node.type === "ObjectProperty") { | ||
return "value"; | ||
@@ -114,0 +116,0 @@ } |
Sorry, the diff of this file is not supported yet
16412
289