1. babel-plugin-transform-strict-mode
This plugin places a 'use strict'; directive at the top of all files to enable strict mode
babel-plugin-transform-strict-mode
Package: babel-plugin-transform-strict-mode
Created by: babel
Last modified: Mon, 13 Jun 2022 04:05:23 GMT
Version: 6.24.1
License: MIT
Downloads: 7,473,228
Repository: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode

Install

npm install babel-plugin-transform-strict-mode
yarn add babel-plugin-transform-strict-mode

babel-plugin-transform-strict-mode

This plugin places a "use strict"; directive at the top of all files to enable strict mode.

This plugin may be enabled via babel-plugin-transform-es2015-modules-commonjs.
If you wish to disable it you can either turn strict off or pass
strictMode: false as an option to the commonjs transform.

Example

In

 foo();

Out

 "use strict";

foo();

Installation

 npm install --save-dev babel-plugin-transform-strict-mode

Usage

Via .babelrc (Recommended)

.babelrc

Without options:

 {
  "plugins": ["transform-strict-mode"]
}

With options:

 {
  "plugins": [
    ["transform-strict-mode", {
      "strict": true
    }]
  ]
}

Via CLI

 babel --plugins transform-strict-mode script.js

Via Node API

 require("babel-core").transform("code", {
  plugins: ["transform-strict-mode"]
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code