title: Line 0: Parsing error: Cannot read property 'map' of undefined
body: <p>Currently starting up the server on my client side, the error above is what I have been
  getting. I am using TypeScript, ReactJS, ESLint. I can't seem to go forward since this error
  has been haunting me. The <a href="https://github.com/eslint/eslint" rel="noreferrer">GitHub page for ESLint</a> hasn't been of much help either.</p>
  <p>This error went up after I had created the useMutation component and exported it in <code>index.ts</code>.
  Not sure how to get rid of this error.</p>
  <pre><code>Below is my package.json
  </code></pre>
  <pre><code>    {
      &quot;name&quot;: &quot;tinyhouse_client&quot;,
      &quot;version&quot;: &quot;0.1.0&quot;,
      &quot;private&quot;: true,
        &quot;dependencies&quot;: {
        &quot;@testing-library/jest-dom&quot;: &quot;^4.2.4&quot;,
        &quot;@testing-library/react&quot;: &quot;^9.3.2&quot;,
        &quot;@testing-library/user-event&quot;: &quot;^7.1.2&quot;,
        &quot;@types/jest&quot;: &quot;^24.0.0&quot;,
        &quot;@types/node&quot;: &quot;^12.0.0&quot;,
        &quot;@types/react&quot;: &quot;^16.9.35&quot;,
        &quot;@types/react-dom&quot;: &quot;^16.9.0&quot;,
        &quot;@typescript-eslint/parser&quot;: &quot;^3.0.2&quot;,
        &quot;react&quot;: &quot;^16.13.1&quot;,
        &quot;react-dom&quot;: &quot;^16.13.1&quot;,
        &quot;react-scripts&quot;: &quot;3.4.1&quot;,
        &quot;typescript&quot;: &quot;~2.23.0&quot;
        },
        &quot;resolutions&quot;: {
       &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^2.23.0&quot;,
       &quot;@typescript-eslint/parser&quot;: &quot;^2.23.0&quot;,
       &quot;@typescript-eslint/typescript-estree&quot;: &quot;^2.23.0&quot;
       },
       &quot;scripts&quot;: {
       &quot;start&quot;: &quot;react-scripts start&quot;,
       &quot; build&quot;: &quot;react-scripts build&quot;,
       &quot;test&quot;: &quot;react-scripts test&quot;,
       &quot;eject&quot;: &quot;react-scripts eject&quot;
       },
       &quot;eslintConfig&quot;: {
       &quot;extends&quot;: &quot;react-app&quot;
       },
       &quot;browserslist&quot;: {
       &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
        &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
       ]
       },
       **strong text** &quot;proxy&quot;: &quot;http://localhost:9000&quot;
        }
  </code></pre>
  <pre><code>Below is my index.ts
  </code></pre>
  <pre><code>    export * from './server';
      export * from './useQuery';
      export * from './useMutation';
  </code></pre>
  <pre><code>And my useMutation.ts
  </code></pre>
  <pre><code>    import { useState } from 'react';
      import { server } from './server';
  
      interface State&lt;TData&gt; {
      data: TData | null;
      loading: boolean; 
      error: boolean;
      }
  
      type MutationTuple&lt;TData, TVariables&gt; = [
      (variables?: TVariables | undefined) =&gt; Promise&lt;void&gt;,
      State&lt;TData&gt;
      ];
  
      export const useMutation = &lt;TData = any, TVariables = any&gt;(
      query: string
      ): MutationTuple&lt;TData, TVariables&gt; =&gt; { 
      const [state, setState] = useState&lt;State&lt;TData&gt;&gt;({
      data: null,
      loading: false,
      error: false,
      })
  
      const fetch = async (variables?: TVariables) =&gt; {
      try {
        setState({ data: null, loading: true, error: false });
  
        const { data, errors } = await server.fetch&lt;TData, TVariables&gt;({ query, variables });
        if (errors &amp;&amp; errors.length) {
          throw new Error(errors[0].message);
        }
  
        setState({ data, loading: false, error: false });
      } catch (err) {
        setState({ data: null, loading: false, error: true });
        throw console.error(err);
      }
     }
  
     return [fetch, state];
  };
  </code></pre>