babel-plugin-transform-strict-mode

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

MIT 39 个版本
安装
npm install babel-plugin-transform-strict-mode
yarn add babel-plugin-transform-strict-mode
pnpm add babel-plugin-transform-strict-mode
bun add babel-plugin-transform-strict-mode
README

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

.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"]
});
版本列表
7.0.0-beta.3 2017-10-15
7.0.0-beta.2 2017-09-26
7.0.0-beta.1 2017-09-19
7.0.0-beta.0 2017-09-12
7.0.0-alpha.20 2017-08-30
7.0.0-alpha.19 2017-08-07
7.0.0-alpha.18 2017-08-03
7.0.0-alpha.17 2017-07-26
7.0.0-alpha.16 2017-07-25
7.0.0-alpha.15 2017-07-12
7.0.0-alpha.14 2017-07-12
7.0.0-alpha.12 2017-05-31
7.0.0-alpha.11 2017-05-31
7.0.0-alpha.10 2017-05-25
7.0.0-alpha.9 2017-04-18
7.0.0-alpha.8 2017-04-17
7.0.0-alpha.7 2017-04-05
7.0.0-alpha.3 2017-03-23
7.0.0-alpha.1 2017-03-02
6.24.1 2017-04-07
6.22.0 2017-01-20
6.18.0 2016-10-24
6.11.3 2016-07-13
6.8.0 2016-05-02
6.6.5 2016-03-04
6.6.4 2016-03-02
6.5.2 2016-02-12
6.5.0-1 2016-02-07
6.5.0 2016-02-07
6.3.13 2015-12-04
6.2.4 2015-11-25
6.2.0 2015-11-19
6.1.18 2015-11-12
6.1.17 2015-11-12
6.1.4 2015-11-11
6.1.2 2015-11-05
6.0.15 2015-11-01
6.0.14 2015-10-30
6.0.2 2015-10-29