10.0.2 β’ Published 5 months ago
@putout/plugin-strict-mode v10.0.2
@putout/plugin-strict-mode
Strict mode makes several changes to normal JavaScript semantics:
- Eliminates some JavaScript silent errors by changing them to throw errors.
- Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode.
- Prohibits some syntax likely to be defined in future versions of ECMAScript.
(c) MDN
πPutout plugin adds ability to add strict mode to CommonJS, and remove from ESM, where it enabled by default. Moved to @putout/plugin-nodejs
.
Install
npm i @putout/plugin-strict-mode -D
Rule
{
"rules": {
"strict-mode/add-missing": "on",
"strict-mode/remove-useless": "on"
}
}
β Example of incorrect code
ESM:
'strict mode';
import a from 'b';
CommonJS:
const a = require('b');
β Example of correct code
ESM:
import a from 'b';
CommonJS:
'strict mode';
const a = require('b');
License
MIT
10.0.2
5 months ago
10.0.0
5 months ago
10.0.1
5 months ago
7.0.0
10 months ago
8.0.0
8 months ago
9.0.0
8 months ago
6.0.0
11 months ago
5.2.0
2 years ago
5.1.0
2 years ago
5.0.0
2 years ago
4.1.0
2 years ago
4.0.0
2 years ago
4.1.1
2 years ago
3.0.0
2 years ago
2.1.0
3 years ago
2.0.0
4 years ago
1.2.5
4 years ago
1.2.4
4 years ago
1.2.3
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago