You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-5Lines changed: 12 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,30 @@ Remove 'use strict' if the file is 'not strict'
5
5
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
1) put the following in above the a file that is not strict:
21
+
1. put the following in above the a file that is not strict:
22
+
20
23
```js
21
-
'not strict'
24
+
"not strict";
25
+
22
26
```
23
27
24
-
2) Add `"babel-plugin-transform-not-strict"` to the list of your babel plugins.
28
+
2. Add `"babel-plugin-transform-not-strict"` to the list of your babel plugins.
25
29
26
30
For example, create a `babel.config.js` file at the root of the project with the following content:
31
+
27
32
```js
28
33
let presets = [];
29
34
@@ -40,6 +45,7 @@ module.exports = {
40
45
### Usage Remove All
41
46
42
47
You can also use this plugin to remove `'use strict'` from all the files. Just pass `removeAll: true`.
48
+
43
49
```js
44
50
let presets = [];
45
51
@@ -63,15 +69,16 @@ module.exports = {
63
69
### Usage Extra Directive or Comment Triggers
64
70
65
71
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'`
0 commit comments