Registry / devops / babel-plugin-transform-beautifier

babel-plugin-transform-beautifier

JSON →
library0.1.1jsnpmunverified

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.

npm install babel-plugin-transform-beautifier
INSTALL
IMPORT
SIG · BABEL-PLUGIN-TRANS
B
babel-plugin-transform-beautifier
devopsjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
module.exports = { plugins: ['babel-plugin-transform-beautifier'] }
import beautifier from 'babel-plugin-transform-beautifier'
Babel plugins are strings, not imported symbols. Use plugin name in Babel config.

Shows how to install and configure the plugin in a Babel config file to beautify ternaries.

// Install: npm i --save-dev babel-plugin-transform-beautifier // babel.config.js module.exports = { plugins: ['babel-plugin-transform-beautifier'] }
Debug
Known issues
deprecatedPackage is unmaintained since 2021. No support for modern Babel (v7.20+). Check for compatibility with your Babel version.
fix
Use an alternative like manual refactoring or a custom codemod.
affects: >=0.1.1
gotchaOnly transforms ternary expressions and logical AND/OR in conditional context. Does not beautify other patterns like nested ternaries or switch statements.
fix
Review transformed output manually; expected beautification may not apply.
affects: *
gotchaPlugin may conflict with other Babel plugins that manipulate AST or formatting (e.g., minifiers, other transforms).
fix
Ensure plugin order and test output with other plugins in pipeline.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-transform-beautifier'
Package not installed or missing from node_modules.
fix
Run 'npm install --save-dev babel-plugin-transform-beautifier' and check your babel config plugin name.
Plugin threw: 'babel-plugin-transform-beautifier' is not a valid plugin
Using incorrect import syntax or missing plugin name as string.
fix
In babel.config.js, use plugins: ['babel-plugin-transform-beautifier'] (string, not a function or variable).
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
babel-plugin-transform-beautifier — npm install babel-plugin-transform-beautifier · libregistry