index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module.exports = {
  2. rules: {
  3. "property": require("./lib/rules/property"),
  4. "method": require("./lib/rules/method")
  5. },
  6. configs: {
  7. DOM: {
  8. plugins: ["no-unsanitized"],
  9. rules: {
  10. "no-unsanitized/property": [
  11. "error",
  12. {
  13. },
  14. {
  15. // Check unsafe assignment to innerHTML
  16. innerHTML: {},
  17. // Check unsafe assignment to outerHTML
  18. outerHTML: {},
  19. }
  20. ],
  21. "no-unsanitized/method": [
  22. "error",
  23. {
  24. },
  25. {
  26. // check second parameter to .insertAdjacentHTML()
  27. insertAdjacentHTML: {
  28. properties: [1]
  29. },
  30. // check first parameter to .write(), as long as the preceeding object matches the regex "document"
  31. write: {
  32. objectMatches: [
  33. "document"
  34. ],
  35. properties: [0]
  36. },
  37. // check first parameter to .writeLn(), as long as the preceeding object matches the regex "document"
  38. writeln: {
  39. objectMatches: [
  40. "document"
  41. ],
  42. properties: [0]
  43. }
  44. }
  45. ]
  46. }
  47. }
  48. }
  49. };