@putout/plugin-convert-const-to-let
Advanced tools
Comparing version
'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); |
{ | ||
"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)", |
5301
6.23%53
17.78%