Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-toml

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-toml - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

lib/index.d.ts
import type { Plugin } from 'prettier';
declare const TomlPlugin: Plugin<string>;
export type * from './options.js';
export type * from './types.js';
export default TomlPlugin;

19

lib/index.js

@@ -1,11 +0,11 @@

import { Taplo } from '@taplo/lib';
import taplo from '@taplo/lib';
import { languages } from './languages.js';
import { prettierOptionsDefinitions } from './options.js';
const PLUGIN_NAME = 'toml';
let taplo;
let taploIns;
async function format(code, options) {
if (!taplo) {
taplo = await Taplo.initialize();
if (!taploIns) {
taploIns = await taplo.Taplo.initialize();
}
return taplo.format(code, { options });
return taploIns.format(code, { options });
}

@@ -16,10 +16,7 @@ const TomlPlugin = {

[PLUGIN_NAME]: {
async parse(code, options) {
const indentString = options.useTabs
? '\t'
: ' '.repeat(options.tabWidth);
return await format(code.trim(), {
parse(code, options) {
return format(code.trim(), {
...options,
columnWidth: options.printWidth,
indentString,
indentString: options.useTabs ? '\t' : ' '.repeat(options.tabWidth),
trailingNewline: true,

@@ -26,0 +23,0 @@ arrayTrailingComma: options.trailingComma !== 'none',

{
"name": "prettier-plugin-toml",
"version": "2.0.0",
"version": "2.0.1",
"type": "module",

@@ -5,0 +5,0 @@ "description": "An opinionated `toml` formatter plugin for Prettier",

Sorry, the diff of this file is not supported yet

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