title: ESLint: Only declares and type imports are allowed inside declare module
body: <p>I tried adding this to my <strong>interfaces.ts</strong> file but ESLint isn't having it:</p>
  <pre><code>declare module 'react' {
    interface HTMLAttributes&lt;T&gt; extends AriaAttributes, DOMAttributes&lt;T&gt; {
      // extends React's HTMLAttributes
      name?: string;
      ref?: HTMLAnchorElement;
      cssClass?: string;
    }
  }
  </code></pre>
  <p><strong>ESLint Parsing error:</strong> `Only declares and type imports are allowed</p>
  <p>I get this same error with this piece of code that lives in <strong>images.d.ts</strong> where it's not liking the <code>const</code> keyword:</p>
  <pre><code>declare module '*.png' {
   const value: any;
   export = value;
  }
  </code></pre>
  <p>Does everyone just put this kind of code to custom <code>.d.ts</code> files and tell eslint to ignore it?</p>
  <p>inside declare module`
  <strong>.eslintrc</strong></p>
  <pre><code>{
    &quot;extends&quot;: [
      &quot;airbnb&quot;,
      &quot;eslint:recommended&quot;,
      &quot;plugin:react/recommended&quot;,
      &quot;plugin:import/errors&quot;
    ],
      &quot;plugins&quot;: [&quot;react&quot;],
      &quot;parser&quot;: &quot;babel-eslint&quot;,
      &quot;parserOptions&quot;: {&quot;ecmaFeatures&quot;: {&quot;jsx&quot;: true}},
      &quot;env&quot;: {&quot;mocha&quot;: true},
      &quot;rules&quot;: {&quot;comma-dangle&quot;: 0,
      &quot;max-classes-per-file&quot;: [0],
      &quot;jsx-a11y/href-no-hash&quot;: [0],
      &quot;complexity&quot;: [&quot;error&quot;, {&quot;max&quot;: 6}],
      &quot;handle-callback-err&quot;: &quot;error&quot;,
      &quot;import/default&quot;: [0],
      &quot;import/order&quot;: [0],
      &quot;max-statements&quot;: [&quot;error&quot;, 30],
      &quot;no-console&quot;: [0],
      &quot;no-constant-condition&quot;: &quot;error&quot;,
      &quot;no-param-reassign&quot;: [&quot;error&quot;, {&quot;props&quot;: false}],
      &quot;no-process-exit&quot;: &quot;error&quot;,
      &quot;no-useless-call&quot;: &quot;error&quot;,
      &quot;react/no-danger&quot;: [0],
      &quot;react/jsx-indent-props&quot;: [0],
      &quot;react/jsx-filename-extension&quot;: [1, {&quot;extensions&quot;: [&quot;.tsx&quot;]}],
      &quot;react/jsx-indent&quot;: [0],
      &quot;react/jsx-tag-spacing&quot;: [&quot;error&quot;, { &quot;beforeSelfClosing&quot;: &quot;always&quot; }],
      &quot;react/jsx-sort-props&quot;: [&quot;error&quot;, {&quot;ignoreCase&quot;: false, &quot;noSortAlphabetically&quot;: false}],
      &quot;react/prefer-stateless-function&quot;: [0, { &quot;ignorePureComponents&quot;: true }],
      &quot;react/no-multi-comp&quot;: [0, { &quot;ignoreStateless&quot;: true }],
      &quot;react/require-optimization&quot;: [0],
      &quot;react/prop-types&quot;: [0],
      &quot;react/no-array-index-key&quot;: [1],
      &quot;semi&quot;: [&quot;error&quot;, &quot;always&quot;],
      &quot;import/no-extraneous-dependencies&quot;: [0],
      &quot;react/destructuring-assignment&quot;: [0],
      &quot;react/jsx-closing-bracket-location&quot;: [1, &quot;after-props&quot;],
      &quot;jsx-one-expression-per-line&quot;: [0],
      &quot;import/extensions&quot;: [0],
      &quot;import/no-unresolved&quot;: [0],
      &quot;no-multiple-empty-lines&quot;: [0],
      &quot;one-var&quot;: [0],
      &quot;max-len&quot;: [&quot;error&quot;, { &quot;code&quot;: 140 }],
      &quot;implicit-arrow-linebreak&quot;: [0],
      &quot;no-shadow&quot;: [0],
      &quot;function-paren-newline&quot;: [0],
      &quot;no-tabs&quot;: [0],
      &quot;indent&quot;: [1, &quot;tab&quot;],
      &quot;no-use-before-define&quot;: [0],
      &quot;no-nested-ternary&quot;: [1],
      &quot;no-restricted-syntax&quot;: [1],
      &quot;no-plusplus&quot;: [1],
      &quot;react/no-find-dom-node&quot;: [1]
    }
  }
  </code></pre>