Registry / devops / babel-plugin-remove-use-strict

babel-plugin-remove-use-strict

JSON →
library1.0.1jsnpmunverified

A Babel plugin that removes all `"use strict"` directives from JavaScript code. Version 1.0.1 is the current stable release; the package has minimal updates and is essentially feature-complete. It is a niche utility for projects where strict mode is unwanted (e.g., legacy code, certain bundling scenarios). Unlike manual regex-based removal, this plugin integrates directly into the Babel pipeline and respects AST, avoiding false positives in string literals or comments.

npm install babel-plugin-remove-use-strict
INSTALL
IMPORT
SIG · BABEL-PLUGIN-REMOV
B
babel-plugin-remove-use-strict
devopsjavascriptv1.0.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
module.exports = { plugins: ["remove-use-strict"] }
import removeUseStrict from 'babel-plugin-remove-use-strict'
This is a Babel plugin, not a JavaScript export. It's used via Babel config, not imported directly.
plugin name string
"remove-use-strict"
"babel-plugin-remove-use-strict"
In .babelrc or babel.config.js, you specify the short name 'remove-use-strict' (without the 'babel-plugin-' prefix).
require("@babel/core").transform
require("@babel/core").transform(code, { plugins: ["remove-use-strict"] })
require("@babel/core").transform(code, { plugins: [require("babel-plugin-remove-use-strict")] })
When using Node API, the plugin is referenced by string name, not required as a module.

Shows basic Babel config and the effect of removing 'use strict' directives from code.

// .babelrc { "plugins": ["remove-use-strict"] } // Input "use strict"; function f() { "use strict"; console.log("use strict"); } // Output function f() { console.log("use strict"); }
Debug
Known issues
gotchaString literals containing 'use strict' (e.g., in console.log) are NOT removed.
fix
The plugin only removes directive nodes; ensure you understand the AST distinction.
affects: <=1.0.1
gotchaThe plugin is designed for Babel 6/7; compatibility with Babel 8 is untested.
fix
Test with your Babel version; consider contributing if issues arise.
affects: >=1.0.0
gotchaRemoving 'use strict' may change module behavior in ES modules or Node.js; it's not polyfilled.
fix
Only use if you understand the implications of disabling strict mode globally.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not find plugin 'babel-plugin-remove-use-strict'. Ensure it is installed.
Missing npm install or incorrect plugin name.
fix
Run 'npm install babel-plugin-remove-use-strict' and use short name 'remove-use-strict' in config.
SyntaxError: Unexpected token (1:1) while parsing "use strict"
Input code is not JavaScript (e.g., JSON) or has syntax error.
fix
Ensure input is valid JavaScript; the plugin works on AST, not raw text.
TypeError: this.Opportunities is not a function
Babel version mismatch (e.g., using Babel 6 plugin in Babel 7).
fix
Use a Babel 7 compatible version or fork the plugin.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
babel-plugin-remove-use-strict — npm install babel-plugin-remove-use-strict · libregistry