Repository: edvardchen/eslint-plugin-i18next (js)

Issue:
Some strings should not be checked
I found this plugin really useful, there are some cases where it complains about strings that should not be checked,

for example:

    document.addEventListener('click', () => {})

or also:

    <svg id='my-icon' viewbox='0 0 32 36' />

If somebody can give me some hint where to start I can try providing a pull request.

Pull request:
fix: whitelist addEventListener and few SVG attributes
Fixes #4 

Patch:
diff --git a/lib/rules/no-literal-string.js b/lib/rules/no-literal-string.js
index ee08c14..7dc4956 100644
--- a/lib/rules/no-literal-string.js
+++ b/lib/rules/no-literal-string.js
@@ -72,10 +72,15 @@ module.exports = {
       }
 
       if (calleeName === 'require') return true;
+
       return calleeWhitelists.simple.indexOf(calleeName) !== -1;
     }
 
-    const atts = ['className', 'style', 'styleName', 'src', 'type', 'id'];
+    const atts = [
+      'className', 'style', 'styleName', 'src', 'type', 'id',
+      // SVG related attributes.
+      'viewBox', 'cx', 'cy', 'r', 'rx', 'ry', 'd', 'x1', 'y1', 'x2', 'y2', 'fill', 'stroke', 'strokeWidth', 'points'
+    ];
     function isValidAttrName(name) {
       return atts.includes(name);
     }
@@ -279,6 +284,7 @@ module.exports = {
 };
 
 const popularCallee = [
+  'addEventListener',
   //
   // ─── VUEX CALLEE ────────────────────────────────────────────────────────────────
   //


Test patch:
diff --git a/tests/lib/rules/no-literal-string.js b/tests/lib/rules/no-literal-string.js
index 51cffbc..89fd6ab 100644
--- a/tests/lib/rules/no-literal-string.js
+++ b/tests/lib/rules/no-literal-string.js
@@ -37,6 +37,7 @@ ruleTester.run('no-literal-string', rule, {
     { code: 'a.includes("ios")' },
     { code: 'export * from "hello_export_all";' },
     { code: 'export { a } from "hello_export";' },
+    { code: 'document.addEventListener("click", (event) => { event.preventDefault() })' },
     { code: 'require("hello");' },
     { code: 'const a = require(["hello"]);' },
     { code: 'const a = require(["hel" + "lo"]);' },
@@ -57,7 +58,11 @@ ruleTester.run('no-literal-string', rule, {
     // JSX
     { code: '<div className="primary"></div>' },
     { code: '<div className={a ? "active": "inactive"}></div>' },
-    { code: '<div>{i18next.t("foo")}</div>' }
+    { code: '<div>{i18next.t("foo")}</div>' },
+    { code: '<svg viewBox="0 0 20 40"></svg>' },
+    { code: '<line x1="0" y1="0" x2="10" y2="20" />' },
+    { code: '<path d="M10 10" />' },
+    { code: '<circle cx="10" cy="10" r="2" fill="red" />' }
   ],
 
   invalid: [