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

eslint-plugin-prefer-let

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-prefer-let - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

lib/rules/prefer-let.js

@@ -39,4 +39,8 @@ /**

function isProgramScope(node) {
return context.getScope().block.type === 'Program';
}
function isTopLevelScope(node) {
return isGlobalScope(node) || isModuleScope(node);
return isGlobalScope(node) || isModuleScope(node) || isProgramScope(node);
}

@@ -43,0 +47,0 @@

3

package.json
{
"name": "eslint-plugin-prefer-let",
"version": "1.0.0",
"version": "1.0.1",
"description": "Rule to prefer using `let` to bind names to values",

@@ -11,2 +11,3 @@ "keywords": [

"author": "Charles Lowell",
"homepage": "https://github.com/cowboyd/eslint-plugin-prefer-let",
"main": "lib/index.js",

@@ -13,0 +14,0 @@ "scripts": {

@@ -39,2 +39,11 @@ /**

code: `export const AlsoObject = Object;`
},
{
parserOptions: {
sourceType: "script"
},
env: {
node: true
},
code: "const PI = 3.14;"
}

@@ -78,4 +87,17 @@ ],

}]
},
{
parserOptions: {
sourceType: "script"
},
env: {
node: true
},
code: "function y() { const x = 'y'; return x; }",
errors: [{
message: "`const` declaration outside top-level scope",
type: "VariableDeclaration"
}]
}
]
});
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