Socket
Socket
Sign inDemoInstall

pretty-ts-errors-lsp

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

26

out/format/formatTypeBlock.js

@@ -16,3 +16,3 @@ "use strict";

}
const prettyType = format(type);
const prettyType = convertToOriginalType(prettifyType(convertToValidType(type), format));
if (prettyType.includes("\n")) {

@@ -29,17 +29,11 @@ return `${prefix}: ${(0, components_1.multiLineCodeBlock)(prettyType, "type")}`;

*/
// function prettifyType(type: string) {
// try {
// // Wrap type with valid statement, format it and extract the type back
// return convertToOriginalType(
// prettify(convertToValidType(type), {
// parser: "typescript",
// printWidth: 60,
// singleAttributePerLine: false,
// arrowParens: "avoid",
// })
// );
// } catch (e) {
// return type;
// }
// }
function prettifyType(type, format) {
try {
// Wrap type with valid statement, format it and extract the type back
return convertToOriginalType(format(convertToValidType(type)));
}
catch (e) {
return type;
}
}
const convertToValidType = (type) => `type x = ${type

@@ -46,0 +40,0 @@ // Add missing parentheses when the type ends with "...""

@@ -6,3 +6,3 @@ {

"description": "Make TypeScript errors prettier and more human-readable in VSCode",
"version": "0.0.1",
"version": "0.0.2",
"icon": "assets/icon.png",

@@ -9,0 +9,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc