# babel-plugin-transform-not-strict

> Remove 'use strict' if the file is 'not strict'

Latest version **0.3.1** (published 2020-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-not-strict
pnpm add babel-plugin-transform-not-strict
yarn add babel-plugin-transform-not-strict
bun add babel-plugin-transform-not-strict
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2020-10-20 |
| First published | 2020-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 113.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Amin Yahyaabadi |
| Maintainers | atom-ide-community |
| Keywords | babel-plugin, use strict, not strict, strictMode, strict, ES6, babel |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-not-strict
- Repository: https://github.com/atom-ide-community/babel-plugin-transform-not-strict
- Homepage: https://github.com/atom-ide-community/babel-plugin-transform-not-strict#readme
- Issues: https://github.com/atom-ide-community/babel-plugin-transform-not-strict/issues
- npm.io page: https://npm.io/package/babel-plugin-transform-not-strict

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2020-10-20
- 0.3.0 — 2020-09-23
- 0.2.1 — 2020-09-18
- 0.2.0 — 2020-09-12
- 0.1.0 — 2020-09-12

## README

# babel-plugin-transform-not-strict

Remove 'use strict' if the file is 'not strict'

Most of the bundlers and transpilers such as babel add `'use strict'` to the above of your file. This plugin will remove them if you add `'not strict'` to that file. You can also use this plugin to remove `'use strict'` from all the files

## Installation
```
npm install --save-dev babel-plugin-transform-not-strict
```

You should also install the peer dependencies:
```
npm install -save-dev "@babel/core"
```

## Usage

1) put the following in above the a file that is not strict:
```js
'not strict'
```

2) Add `"babel-plugin-transform-not-strict"` to the list of your babel plugins.

For example, create a `babel.config.js` file at the root of the project with the following content:
```js
let presets = [];

let plugins = ["babel-plugin-transform-not-strict"];

module.exports = {
  presets: presets,
  plugins: plugins,
  exclude: "node_modules/**",
  sourceMap: "inline",
};
```

### Usage Remove All

You can also use this plugin to remove `'use strict'` from all the files. Just pass `removeAll: true`.
```js
let presets = [];

let plugins = [
  [
    "babel-plugin-transform-not-strict",
    {
      removeAll: true,
    },
  ],
];

module.exports = {
  presets: presets,
  plugins: plugins,
  exclude: "node_modules/**",
  sourceMap: "inline",
};
```

### Usage Extra Directive or Comment Triggers

You can add more directive or comment triggers for removal of `'use strict'`. In the following example, `'use babel'` directive or comments that include `'@babel'` or `'@flow'` also instruct the plugin to become active and remove `'use strict'`
```js
let presets = [];

let plugins = [
  [
    "babel-plugin-transform-not-strict",
    {
      directiveTriggers: ['use babel'],
      commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
    },
  ],
];

module.exports = {
  presets: presets,
  plugins: plugins,
  exclude: "node_modules/**",
  sourceMap: "inline",
};
```

---
_Source: https://npm.io/package/babel-plugin-transform-not-strict · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
