eslint-plugin-prefer-let
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -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 @@ |
{ | ||
"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" | ||
}] | ||
} | ||
] | ||
}); |
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
eslint-plugin-prettier |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
8043
163
0
7
1