The only way to use Hardhat 2 with ESM is to rename the Hardhat config file with cjs or cts prefix.
Therefore, hardhat.config.{cjs,cts} file should be scanned as well along with hardhat.config.{js,ts}.
( Without this hardhat-vscode extension would raise an error that contracts are not found )