title: How can I use hardhat.ethers inside a typescript task?
body: <p>Following code <em>can't find 'ethers'</em>:</p>
  <pre><code>import { HardhatUserConfig, task } from &quot;hardhat/config&quot;;
  import &quot;@nomicfoundation/hardhat-toolbox&quot;;
  
  task('read',async () =&gt; {
      const contract = ethers.getContractFactory('AwesomeContract');
      // ...
  })
  
  const config: HardhatUserConfig = {
    solidity: &quot;0.8.15&quot;,
  };
  
  export default config;
  </code></pre>
  <p>Of course the developer can't do this:</p>
  <pre><code>import { ethers } from 'hardhat';
  </code></pre>
  <p>because it throws <a href="https://hardhat.org/hardhat-runner/docs/errors#HH9" rel="nofollow noreferrer">HH9</a>.</p>
  <p>Is it possible to use hardhat.ethers inside typescript tasks?</p>