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

Issue:
Ignoring styled-components
Hello, we are using styled components (https://styled-components.com/) quite a lot with this format:

```
const StyledParagaph = styled.p`
     ....some css here
`
```

or

```
const StyledFlex = styled(Flex)`
     ....some css here
`
```

I know I can just ignore these directly in the file like this:

```
/* eslint-disable i18next/no-literal-string */
const StyledFlex = styled(Flex)`
     ....some css here
`
/* eslint-disable i18next/no-literal-string */
```
But we have hundreds of these so it's quite cumbersome to do it for every one. Is there currently a way to ignore the text in the backticks in my eslint config rather than explicitly ignoring these everywhere?

I have tried adding `"styled.*"` to `callees.exclude` with no success. We are using template literals for strings that need to be translated as well so I am not able to just turn off the `should-validate-template` option

Would appreciate any guidance or confirmation that this is even possible currently. Thanks!

Pull request:
feat: allow to ignore tag template via callees
closes #122

Patch:
diff --git a/lib/rules/no-literal-string.js b/lib/rules/no-literal-string.js
index 3891ab7..057dd24 100644
--- a/lib/rules/no-literal-string.js
+++ b/lib/rules/no-literal-string.js
@@ -249,6 +249,13 @@ module.exports = {
       },
       'CallExpression:exit': endIndicator,
 
+      TaggedTemplateExpression(node) {
+        indicatorStack.push(
+          isValidFunctionCall(context, options, { callee: node.tag })
+        );
+      },
+      'TaggedTemplateExpression:exit': endIndicator,
+
       'SwitchCase > Literal'(node) {
         indicatorStack.push(true);
       },


Test patch:
diff --git a/tests/lib/rules/no-literal-string/should-validate-template.js b/tests/lib/rules/no-literal-string/should-validate-template.js
index 3a4a8a7..ef92d15 100644
--- a/tests/lib/rules/no-literal-string/should-validate-template.js
+++ b/tests/lib/rules/no-literal-string/should-validate-template.js
@@ -1,7 +1,5 @@
-const testFile = require('../../helpers/testFile');
 const runTest = require('../../helpers/runTest');
 
-const options = [{ mode: 'all', 'should-validate-template': true }];
 const cases = {
   valid: [
     {
@@ -9,29 +7,34 @@ const cases = {
 	var a = \`12345\`
 	var a = \`\`
   `,
-      options,
+      options: [{ mode: 'all', 'should-validate-template': true }],
     },
 
     {
       code: 'var a = `hello ${abc} world`',
+      options: [{ mode: 'jsx-only', 'should-validate-template': true }],
+    },
+
+    {
+      code: 'const StyledParagaph = styled.p`some css here`',
       options: [
         {
-          mode: 'jsx-only',
+          mode: 'all',
+          callees: { exclude: ['styled.*'] },
           'should-validate-template': true,
         },
       ],
     },
   ],
   invalid: [
-    { code: 'var a = `hello ${abc} world`', options, errors: 1 },
+    {
+      code: 'var a = `hello ${abc} world`',
+      options: [{ mode: 'all', 'should-validate-template': true }],
+      errors: 1,
+    },
     {
       code: 'var a = "hello world"; <>`abcd`</>',
-      options: [
-        {
-          mode: 'jsx-only',
-          'should-validate-template': true,
-        },
-      ],
+      options: [{ mode: 'jsx-only', 'should-validate-template': true }],
       errors: 1,
     },
   ],