зеркало из
1
0
Форкнуть 0
eslint-plugin-no-unsanitized/index.js

55 строки
1.7 KiB
JavaScript
Исходник Постоянная ссылка Обычный вид История

2015-09-10 13:46:42 +03:00
/* global module, require */
2015-05-13 12:13:15 +03:00
module.exports = {
rules: {
"property": require("./lib/rules/property"),
"method": require("./lib/rules/method")
2017-05-09 09:58:05 +03:00
},
configs: {
2017-05-09 09:58:05 +03:00
DOM: {
rules: {
"no-unsanitized/property": [
2017-05-09 09:58:05 +03:00
"error",
{
},
{
// Check unsafe assignment to innerHTML
innerHTML: {},
// Check unsafe assignment to outerHTML
outerHTML: {},
}
],
"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
}
};