diff --git a/package.json b/package.json index 5855eb5..3a6f176 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@putout/plugin-remove-empty": "^12.1.0", "@putout/plugin-remove-nested-blocks": "^6.3.0", "@putout/plugin-remove-unreachable-code": "^1.2.0", - "@putout/plugin-remove-unreferenced-variables": "^3.0.0", + "@putout/plugin-remove-unreferenced-variables": "^4.0.0", "@putout/plugin-remove-unused-expressions": "^8.0.0", "@putout/plugin-remove-unused-variables": "^9.0.0", "@putout/plugin-remove-useless-arguments": "^8.0.0", diff --git a/test/fixture/remove-unreferenced-variables-fix.js b/test/fixture/remove-unreferenced-variables-fix.js index d4f7725..8e168d0 100644 --- a/test/fixture/remove-unreferenced-variables-fix.js +++ b/test/fixture/remove-unreferenced-variables-fix.js @@ -1 +1 @@ -let a;a=5;console.log(a); \ No newline at end of file +let a;a=5;console.log(a);function b(){}console.log(type,b); \ No newline at end of file diff --git a/test/fixture/remove-unreferenced-variables.js b/test/fixture/remove-unreferenced-variables.js index a24bdb5..fcb4aa9 100644 --- a/test/fixture/remove-unreferenced-variables.js +++ b/test/fixture/remove-unreferenced-variables.js @@ -4,4 +4,10 @@ let b; a = 5; b = 6; -console.log(a); \ No newline at end of file +console.log(a); + +function runUpdates() { + let t = 1; + 1 ? (t = 0) : 1; +} +console.log(type, runUpdates) \ No newline at end of file