/
index.js
46 lines (43 loc) · 1.53 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module.exports = {
rules: {
property: require("./lib/rules/property"),
method: require("./lib/rules/method"),
},
configs: {
DOM: {
plugins: ["no-unsanitized"],
rules: {
"no-unsanitized/property": [
"error",
{},
{
// Check unsafe assignment to innerHTML
innerHTML: {},
// Check unsafe assignment to outerHTML
outerHTML: {},
},
],
"no-unsanitized/method": [
"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],
},
},
],
},
},
},
};