Hardhat can now have config files with .cjs file extensions, see using esm.
.cjs
The vscode extension needs to support hardhat config files with .cjs as the extension.