Socket
Socket
Sign inDemoInstall

eslint-plugin-etc

Package Overview
Dependencies
157
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.0 to 1.5.1

8

CHANGELOG.md

@@ -0,1 +1,9 @@

<a name="1.5.1"></a>
## [1.5.1](https://github.com/cartant/eslint-plugin-etc/compare/v1.5.0...v1.5.1) (2021-06-16)
## Fixes
- Deem labeled statements to be non-code in the `no-commented-out-code` rule. ([e64c8e2](https://github.com/cartant/eslint-plugin-etc/commit/e64c8e2))
<a name="1.5.0"></a>

@@ -2,0 +10,0 @@

19

dist/rules/no-commented-out-code.js

@@ -33,7 +33,9 @@ "use strict";

const node = sourceCode.getNodeByRangeIndex(index);
parse(wrapContent(content, node), parserOptions);
context.report({
loc,
messageId: "forbidden",
});
const program = parse(wrapContent(content, node), parserOptions);
if (!isLabeledStatement(program)) {
context.report({
loc,
messageId: "forbidden",
});
}
}

@@ -47,5 +49,10 @@ }

});
function isLabeledStatement(program) {
return (program.type === "Program" &&
program.body.length === 1 &&
program.body[0].type === "LabeledStatement");
}
function isUnintentionallyParsable(content) {
return (/^\s*$/.test(content) ||
/^\s*[_#$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(:\s*[_#$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*$/i.test(content));
/^\s*[_#$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*\s*$/i.test(content));
}

@@ -52,0 +59,0 @@ function toBlocks(comments) {

@@ -26,3 +26,3 @@ {

"lint-staged": "^11.0.0",
"mocha": "^8.0.0",
"mocha": "^9.0.0",
"prettier": "~2.3.0",

@@ -78,3 +78,3 @@ "rimraf": "^3.0.0",

},
"version": "1.5.0"
"version": "1.5.1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc