New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@huggingface/prettier-plugin-vertical-align

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/prettier-plugin-vertical-align - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

24

dist/printer.js

@@ -23,5 +23,5 @@ import prettier from "prettier";

// }
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]) {

@@ -48,2 +48,3 @@ const keyLength = node[keyLengthSymbol];

}
case "PropertyDefinition":
case "TSPropertySignature":

@@ -66,4 +67,3 @@ node.typeAnnotation[typeAnnotationPrefix] = addedLength;

const properties = nodeProperties(node).filter((node) => !isProperty(node)
?
node.loc.start.line === node.loc.end.line
? node.loc.start.line === node.loc.end.line
: node.key.loc.start.line === node[valueField(node)].loc.start.line);

@@ -102,3 +102,6 @@ for (const prop of properties) {

function isPropertyContainer(node) {
return node.type === "ObjectExpression" || node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral";
return (node.type === "ObjectExpression" ||
node.type === "TSInterfaceBody" ||
node.type === "TSTypeLiteral" ||
node.type === "ClassBody");
}

@@ -109,3 +112,3 @@ function nodeProperties(node) {

}
if (node.type === "TSInterfaceBody") {
if (node.type === "TSInterfaceBody" || node.type === "ClassBody") {
return node.body;

@@ -120,3 +123,6 @@ }

// JS has ObjectProperty, TS has Property
return node.type === "Property" || node.type === "TSPropertySignature" || node.type === "ObjectProperty";
return (node.type === "Property" ||
node.type === "TSPropertySignature" ||
node.type === "ObjectProperty" ||
node.type === "PropertyDefinition");
}

@@ -127,3 +133,3 @@ function valueField(node) {

}
if (node.type === "TSPropertySignature") {
if (node.type === "TSPropertySignature" || node.type === "PropertyDefinition") {
return "typeAnnotation";

@@ -130,0 +136,0 @@ }

{
"name": "@huggingface/prettier-plugin-vertical-align",
"packageManager": "pnpm@9.11.0",
"version": "0.1.4",
"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"
}
}
"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"
}
}

@@ -33,5 +33,5 @@ import type { AstPath, Printer } from "prettier";

if (node.type === "Program") {
// console.log("node", inspect(node.body, { depth: 10 }));
}
// if (node.type === "Program") {
// console.log("node", inspect(node.body, { depth: 10 }));
// }

@@ -62,2 +62,3 @@ if (node[keyLengthSymbol]) {

}
case "PropertyDefinition":
case "TSPropertySignature":

@@ -84,4 +85,3 @@ node.typeAnnotation[typeAnnotationPrefix] = addedLength;

!isProperty(node)
?
node.loc.start.line === node.loc.end.line
? node.loc.start.line === node.loc.end.line
: node.key.loc.start.line === node[valueField(node)].loc.start.line,

@@ -131,3 +131,8 @@ );

function isPropertyContainer(node: AstPath["node"]) {
return node.type === "ObjectExpression" || node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral";
return (
node.type === "ObjectExpression" ||
node.type === "TSInterfaceBody" ||
node.type === "TSTypeLiteral" ||
node.type === "ClassBody"
);
}

@@ -139,3 +144,3 @@

}
if (node.type === "TSInterfaceBody") {
if (node.type === "TSInterfaceBody" || node.type === "ClassBody") {
return node.body;

@@ -151,3 +156,8 @@ }

// JS has ObjectProperty, TS has Property
return node.type === "Property" || node.type === "TSPropertySignature" || node.type === "ObjectProperty";
return (
node.type === "Property" ||
node.type === "TSPropertySignature" ||
node.type === "ObjectProperty" ||
node.type === "PropertyDefinition"
);
}

@@ -159,3 +169,3 @@

}
if (node.type === "TSPropertySignature") {
if (node.type === "TSPropertySignature" || node.type === "PropertyDefinition") {
return "typeAnnotation";

@@ -162,0 +172,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc