{"id":20191,"library":"liquidsoap-prettier","title":"Liquidsoap Prettier","description":"A Prettier plugin and CLI tool for formatting Liquidsoap scripts (`.liq` files). Current stable version is 1.8.3. The package provides both a command-line utility for direct formatting and a Prettier plugin that integrates into existing workflows. It uses a JSON parser exported via js_of_ocaml from the Liquidsoap codebase. Regularly updated to match Liquidsoap language changes.","status":"active","version":"1.8.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install liquidsoap-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add liquidsoap-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add liquidsoap-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for plugin functionality","package":"prettier","optional":true}],"imports":[{"note":"ESM-only package; CommonJS require is not supported.","wrong":"require('liquidsoap-prettier')","symbol":"default","correct":"import liquidsoap-prettier from 'liquidsoap-prettier'"},{"note":"Named export for the plugin object.","symbol":"liquidsoap-prettier","correct":"import { liquidsoap-prettier } from 'liquidsoap-prettier'"},{"note":"Plugin is a named export, not default.","wrong":"import Plugin from 'liquidsoap-prettier'","symbol":"Plugin","correct":"import { Plugin } from 'liquidsoap-prettier'"}],"quickstart":{"code":"// Install dependencies\nnpm install -D prettier liquidsoap-prettier\n\n// Create a .prettierrc file with:\n{\n  \"plugins\": [\"liquidsoap-prettier\"]\n}\n\n// Run Prettier on a Liquidsoap file\nnpx prettier --write path/to/file.liq\n\n// Alternatively, use the CLI directly\nnpx liquidsoap-prettier -w path/to/file.liq\n\n// Check formatting (CI)\nnpx liquidsoap-prettier -c path/to/file.liq","lang":"typescript","description":"Installation and basic usage of liquidsoap-prettier as both a Prettier plugin and standalone CLI."},"warnings":[{"fix":"Run `npm run dev:prepare` or install Liquidsoap via opam.","message":"The package does not bundle the Liquidsoap parser; must run `npm run dev:prepare` or have opam installed for parser updates.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use ESM import syntax or configure Prettier to handle ESM.","message":"Using require() to import the plugin is deprecated in favor of ESM imports.","severity":"deprecated","affected_versions":">=1.5"},{"fix":"Update to v1.0+ and use proper plugin registration in .prettierrc.","message":"Plugin API changed; old import paths no longer work.","severity":"breaking","affected_versions":"<1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install -D liquidsoap-prettier` in your project.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'liquidsoap-prettier'"},{"fix":"Ensure the Liquidsoap version matches the parser version; update parser via `npm run dev:prepare`.","cause":"Liquidsoap parser cannot parse file with unsupported syntax.","error":"SyntaxError: Unexpected token '#'"},{"fix":"Use Node >=14 and import from 'liquidsoap-prettier' only.","cause":"Using an outdated Node version or incorrect import path.","error":"Error: Package subpath './package.json' is not defined by \"exports\""}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}