{"library":"prettier-plugin-pdx-script","title":"Prettier Plugin for PDXScript (Paradox Game Script)","description":"A Prettier plugin for formatting PDXScript files used by Paradox Interactive games (Victoria 3, Hearts of Iron IV, Stellaris, etc.). v0.1.0-rc.6, pre-release with pre-1.0 API. Uses tree-sitter WASM parser for reliable parsing and applies opinionated formatting rules (tab indentation, operator preservation, comment handling). Ships dual CJS/ESM builds and TypeScript types. Differentiates from manual formatting by providing automated, consistent formatting via Prettier ecosystem. Key design: converts tree-sitter AST to plain objects for Prettier traversal.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-pdx-script"],"cli":null},"imports":["import prettierPluginPdxScript from 'prettier-plugin-pdx-script'","import { resetParser } from 'prettier-plugin-pdx-script'","import { disposeParser } from 'prettier-plugin-pdx-script'","import { getGrammarWasmPath } from 'prettier-plugin-pdx-script'","import { PARSER_NAME } from 'prettier-plugin-pdx-script'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm install --save-dev prettier prettier-plugin-pdx-script\n\n// Format via CLI:\n// npx prettier --write \"path/to/**/*.txt\"\n\n// Programmatic usage:\nimport prettier from 'prettier';\n\nconst code = `my_declaration={\n    key1= value1\n    nested={\n        inner_key = \"hello world\"\n    }\n    # a comment\n}\n`;\n\nconst formatted = await prettier.format(code, {\n  parser: 'pdx-script',\n  plugins: ['prettier-plugin-pdx-script'],\n  tabWidth: 4 // Not used; plugin uses tabs\n});\n\nconsole.log(formatted);\n// Output:\n// my_declaration = {\n// \\tkey1 = value1\n// \\tnested = {\n// \\t\\tinner_key = \"hello world\"\n// \\t}\n// \\t# a comment\n// }","lang":"typescript","description":"Quickstart: install, CLI usage, and programmatic formatting with Prettier and the PDXScript plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}