{"id":19179,"library":"babel-plugin-transform-beautifier","title":"babel-plugin-transform-beautifier","description":"A Babel plugin (v0.1.1) that transforms JavaScript conditional expressions (ternary, logical AND/OR) into if/else statements for improved readability. It is a niche tool focused solely on beautifying ternaries, with no updates since 2021 and low maintenance. Unlike general formatters (Prettier) or codemods (jscodeshift), it performs a specific AST transformation. Intended for build-time use in Babel pipelines.","status":"deprecated","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/gzzhanghao/babel-plugin-transform-beautifier","tags":["javascript"],"install":[{"cmd":"npm install babel-plugin-transform-beautifier","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-transform-beautifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-transform-beautifier","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Babel plugins are strings, not imported symbols. Use plugin name in Babel config.","wrong":"import beautifier from 'babel-plugin-transform-beautifier'","symbol":"default export","correct":"module.exports = { plugins: ['babel-plugin-transform-beautifier'] }"}],"quickstart":{"code":"// Install: npm i --save-dev babel-plugin-transform-beautifier\n// babel.config.js\nmodule.exports = {\n  plugins: ['babel-plugin-transform-beautifier']\n}","lang":"javascript","description":"Shows how to install and configure the plugin in a Babel config file to beautify ternaries."},"warnings":[{"fix":"Use an alternative like manual refactoring or a custom codemod.","message":"Package is unmaintained since 2021. No support for modern Babel (v7.20+). Check for compatibility with your Babel version.","severity":"deprecated","affected_versions":">=0.1.1"},{"fix":"Review transformed output manually; expected beautification may not apply.","message":"Only transforms ternary expressions and logical AND/OR in conditional context. Does not beautify other patterns like nested ternaries or switch statements.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure plugin order and test output with other plugins in pipeline.","message":"Plugin may conflict with other Babel plugins that manipulate AST or formatting (e.g., minifiers, other transforms).","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev babel-plugin-transform-beautifier' and check your babel config plugin name.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'babel-plugin-transform-beautifier'"},{"fix":"In babel.config.js, use plugins: ['babel-plugin-transform-beautifier'] (string, not a function or variable).","cause":"Using incorrect import syntax or missing plugin name as string.","error":"Plugin threw: 'babel-plugin-transform-beautifier' is not a valid plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}