@putout/plugin-strict-mode
putout plugin adds ability to add or remove strict mode directive
Last updated 5 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-strict-mode 
SYNC missed versions from official npm registry.

@putout/plugin-strict-mode NPM version

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

Current Tags

  • 10.0.2                                ...           latest (3 years ago)

27 Versions

  • 10.0.2                                ...           3 years ago
  • 10.0.1                                ...           3 years ago
  • 10.0.0                                ...           3 years ago
  • 9.0.0                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.0                                ...           3 years ago
  • 5.2.0                                ...           4 years ago
  • 5.1.0                                ...           4 years ago
  • 5.0.0                                ...           5 years ago
  • 4.1.1                                ...           5 years ago
  • 4.1.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.2.5                                ...           7 years ago
  • 1.2.4                                ...           7 years ago
  • 1.2.3                                ...           7 years ago
  • 1.2.2                                ...           7 years ago
  • 1.2.1                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 22
Today 0
This Week 0
This Month 14
Last Day 0
Last Week 1
Last Month 6
Dependencies (0)
None
Dev Dependencies (9)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE