🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@putout/plugin-convert-const-to-let

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/plugin-convert-const-to-let - npm Package Compare versions

Comparing version

to
4.2.0

12

lib/convert-const-to-let.js
'use strict';
const {types} = require('putout');
const {
isBlockStatement,
isProgram,
} = types;
const {values} = Object;
const isKeyword = (a) => [

@@ -11,2 +18,4 @@ 'export',

const isInsideBlock = ({parentPath}) => isProgram(parentPath) || isBlockStatement(parentPath);
module.exports.report = () => `Use 'let' when reassign`;

@@ -48,2 +57,5 @@

if (!binding.path.node.init && isInsideBlock(binding.path.parentPath))
continue;
if (parentPath.node.kind === 'const')

@@ -50,0 +62,0 @@ push(binding.path.parentPath);

2

package.json
{
"name": "@putout/plugin-convert-const-to-let",
"version": "4.1.0",
"version": "4.2.0",
"type": "commonjs",

@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",