{"id":19150,"library":"babel-plugin-remove-use-strict","title":"babel-plugin-remove-use-strict","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/tswordyao/babel-plugin-remove-use-strict","tags":["javascript","babel","plugin","remove","use","strict"],"install":[{"cmd":"npm install babel-plugin-remove-use-strict","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-remove-use-strict","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-remove-use-strict","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a Babel plugin, not a JavaScript export. It's used via Babel config, not imported directly.","wrong":"import removeUseStrict from 'babel-plugin-remove-use-strict'","symbol":"default","correct":"module.exports = { plugins: [\"remove-use-strict\"] }"},{"note":"In .babelrc or babel.config.js, you specify the short name 'remove-use-strict' (without the 'babel-plugin-' prefix).","wrong":"\"babel-plugin-remove-use-strict\"","symbol":"plugin name string","correct":"\"remove-use-strict\""},{"note":"When using Node API, the plugin is referenced by string name, not required as a module.","wrong":"require(\"@babel/core\").transform(code, { plugins: [require(\"babel-plugin-remove-use-strict\")] })","symbol":"require(\"@babel/core\").transform","correct":"require(\"@babel/core\").transform(code, { plugins: [\"remove-use-strict\"] })"}],"quickstart":{"code":"// .babelrc\n{\n  \"plugins\": [\"remove-use-strict\"]\n}\n\n// Input\n\"use strict\";\nfunction f() {\n  \"use strict\";\n  console.log(\"use strict\");\n}\n\n// Output\nfunction f() {\n  console.log(\"use strict\");\n}","lang":"javascript","description":"Shows basic Babel config and the effect of removing 'use strict' directives from code."},"warnings":[{"fix":"The plugin only removes directive nodes; ensure you understand the AST distinction.","message":"String literals containing 'use strict' (e.g., in console.log) are NOT removed.","severity":"gotcha","affected_versions":"<=1.0.1"},{"fix":"Test with your Babel version; consider contributing if issues arise.","message":"The plugin is designed for Babel 6/7; compatibility with Babel 8 is untested.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Only use if you understand the implications of disabling strict mode globally.","message":"Removing 'use strict' may change module behavior in ES modules or Node.js; it's not polyfilled.","severity":"gotcha","affected_versions":">=1.0.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 babel-plugin-remove-use-strict' and use short name 'remove-use-strict' in config.","cause":"Missing npm install or incorrect plugin name.","error":"Error: Could not find plugin 'babel-plugin-remove-use-strict'. Ensure it is installed."},{"fix":"Ensure input is valid JavaScript; the plugin works on AST, not raw text.","cause":"Input code is not JavaScript (e.g., JSON) or has syntax error.","error":"SyntaxError: Unexpected token (1:1) while parsing \"use strict\""},{"fix":"Use a Babel 7 compatible version or fork the plugin.","cause":"Babel version mismatch (e.g., using Babel 6 plugin in Babel 7).","error":"TypeError: this.Opportunities is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}