2015-09-10 13:46:42 +03:00
|
|
|
/* global module, require */
|
2015-05-13 12:13:15 +03:00
|
|
|
module.exports = {
|
|
|
|
rules: {
|
2017-04-19 16:28:38 +03:00
|
|
|
"property": require("./lib/rules/property"),
|
|
|
|
"method": require("./lib/rules/method")
|
2017-05-09 09:58:05 +03:00
|
|
|
},
|
2017-05-15 16:58:51 +03:00
|
|
|
configs: {
|
2017-05-09 09:58:05 +03:00
|
|
|
DOM: {
|
|
|
|
rules: {
|
2017-05-15 16:58:51 +03:00
|
|
|
"no-unsanitized/property": [
|
2017-05-09 09:58:05 +03:00
|
|
|
"error",
|
|
|
|
{
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
// Check unsafe assignment to innerHTML
|
|
|
|
innerHTML: {},
|
|
|
|
|
|
|
|
// Check unsafe assignment to outerHTML
|
|
|
|
outerHTML: {},
|
|
|
|
}
|
|
|
|
],
|
2017-05-15 16:58:51 +03:00
|
|
|
"no-unsanitized/method": [
|
2017-05-09 09:58:05 +03:00
|
|
|
"error",
|
|
|
|
{
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
// check second parameter to .insertAdjacentHTML()
|
|
|
|
insertAdjacentHTML: {
|
|
|
|
properties: [1]
|
|
|
|
},
|
|
|
|
|
|
|
|
// check first parameter to .write(), as long as the preceeding object matches the regex "document"
|
|
|
|
write: {
|
|
|
|
objectMatches: [
|
|
|
|
"document"
|
|
|
|
],
|
|
|
|
properties: [0]
|
|
|
|
},
|
|
|
|
|
|
|
|
// check first parameter to .writeLn(), as long as the preceeding object matches the regex "document"
|
|
|
|
writeln: {
|
|
|
|
objectMatches: [
|
|
|
|
"document"
|
|
|
|
],
|
|
|
|
properties: [0]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2015-05-13 12:13:15 +03:00
|
|
|
}
|
|
|
|
};
|