Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@putout/plugin-strict-mode

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/plugin-strict-mode

🐊Putout plugin adds ability to add or remove strict mode directive

  • 5.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@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.

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

Keywords

FAQs

Package last updated on 14 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc