Socket
Socket
Sign inDemoInstall

eslint-plugin-no-unsanitized

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-unsanitized - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

docs/dependents.md

6

lib/ruleHelper.js

@@ -204,5 +204,5 @@ /**

const ruleCheck = Object.assign({},
defaultRuleChecks[ruleCheckKey],
parentRuleChecks,
childRuleChecks[ruleCheckKey]);
defaultRuleChecks[ruleCheckKey],
parentRuleChecks,
childRuleChecks[ruleCheckKey]);
ruleCheckOutput[ruleCheckKey] = ruleCheck;

@@ -209,0 +209,0 @@ });

@@ -23,2 +23,7 @@ /* global module */

// check first parameter to createContextualFragment()
createContextualFragment: {
properties: [0]
},
// check first parameter to .write(), as long as the preceeding object matches the regex "document"

@@ -68,2 +73,3 @@ write: {

case "ThisExpression":
case "NewExpression":
break;

@@ -81,3 +87,4 @@

description: "ESLint rule to disallow unsanitized method calls",
category: "possible-errors"
category: "possible-errors",
url: "https://github.com/mozilla/eslint-plugin-no-unsanitized/tree/master/docs/rules/method.md"
},

@@ -84,0 +91,0 @@ /* schema statement TBD until we have options

@@ -31,3 +31,4 @@ /* global module */

description: "ESLint rule to disallow unsanitized property assignment",
category: "possible-errors"
category: "possible-errors",
url: "https://github.com/mozilla/eslint-plugin-no-unsanitized/tree/master/docs/rules/property.md"
},

@@ -34,0 +35,0 @@ /* schema statement TBD until we have options

{
"name": "eslint-plugin-no-unsanitized",
"description": "ESLint rule to disallow unsanitized code",
"version": "2.0.2",
"version": "3.0.0",
"author": {

@@ -12,6 +12,7 @@ "name": "Frederik Braun et al."

"devDependencies": {
"mocha": "^3.2.0"
"mocha": "^3.2.0",
"eslint": "^4.16.0"
},
"dependencies": {
"eslint": "^3.19.0"
"peerDependencies": {
"eslint": ">=3"
},

@@ -18,0 +19,0 @@ "homepage": "https://github.com/mozilla/eslint-plugin-no-unsanitized/",

@@ -118,2 +118,33 @@ /* global require */

code: "function foo() { return this().bar(); };",
},
// issue 73 https://github.com/mozilla/eslint-plugin-no-unsanitized/issues/73
{
code: "new Function()();",
},
{ // issue 79
code: "range.createContextualFragment('<p class=\"greeting\">Hello!</p>');"
},
{ // issue 79
code: "range.createContextualFragment(Sanitizer.escapeHTML`<em>${evil}</em>`);",
parserOptions: { ecmaVersion: 6 },
options: [
{
escape: {
methods: ["escaper"]
}
}
]
},
{ // issue 79
code: "range.createContextualFragment(escaper('<em>'+evil+'</em>'));",
options: [
{
escape: {
methods: ["escaper"]
}
}
]
}

@@ -264,4 +295,15 @@ ],

]
},
// Issue 79: Warn for use of createContextualFragment
{
code: "range.createContextualFragment(badness)",
errors: [
{
message: "Unsafe call to range.createContextualFragment for argument 0",
type: "CallExpression"
}
]
}
]
});
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