Skip to content

Commit

Permalink
fix: add importAssertion prettier plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Jan 29, 2024
1 parent b5b4630 commit 78af8b5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
4 changes: 3 additions & 1 deletion .eslint-tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"include": [
"tests",
"docgen-templates",
"commitlint.config.js"
"commitlint.config.js",
"wagmi.config.ts",
"environment.d.ts"
]
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bracketSpacing": true,
"endOfLine": "auto",
"importOrder": ["module-alias/register", "<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderParserPlugins": ["typescript"],
"importOrderParserPlugins": ["typescript", "importAssertions"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"printWidth": 120,
Expand Down
4 changes: 2 additions & 2 deletions src/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
FORKED_NETWORK: 'bsctestnet' | 'bscmainnet'
FORKED_NETWORK: "bsctestnet" | "bscmainnet";
}
}
}

// If this file has no import/export statements (i.e. is a script)
// convert it into a module by adding an empty export statement.
export { };
export {};
47 changes: 23 additions & 24 deletions wagmi.config.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
import { defineConfig } from '@wagmi/cli'
import { hardhat } from '@wagmi/cli/plugins'
import poolLensArtifact from '@venusprotocol/isolated-pools/artifacts/contracts/Lens/PoolLens.sol/PoolLens.json' assert { type: "json"};
import diamondComptrollerArtifact from '@venusprotocol/venus-protocol/artifacts/contracts/Comptroller/Diamond/DiamondConsolidated.sol/DiamondConsolidated.json' assert { type: "json"};
import ilComptrollerArtifact from '@venusprotocol/isolated-pools/artifacts/contracts/Comptroller.sol/Comptroller.json' assert { type: "json"};
import coreVTokenArtifact from '@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VBep20Delegate.sol/VBep20Delegate.json' assert { type: "json"};
import protocolShareReserveArtifact from '@venusprotocol/protocol-reserve/artifacts/contracts/ProtocolReserve/ProtocolShareReserve.sol/ProtocolShareReserve.json' assert { type: "json"};
import vBnbAdminArtifact from '@venusprotocol/venus-protocol/artifacts/contracts/Admin/VBNBAdmin.sol/VBNBAdmin.json' assert { type: "json"};
import vBNB from '@venusprotocol/venus-protocol/artifacts/contracts/Admin/VBNBAdminStorage.sol/VTokenInterface.json' assert { type: "json"};

import ilComptrollerArtifact from "@venusprotocol/isolated-pools/artifacts/contracts/Comptroller.sol/Comptroller.json" assert { type: "json" };
import poolLensArtifact from "@venusprotocol/isolated-pools/artifacts/contracts/Lens/PoolLens.sol/PoolLens.json" assert { type: "json" };
import protocolShareReserveArtifact from "@venusprotocol/protocol-reserve/artifacts/contracts/ProtocolReserve/ProtocolShareReserve.sol/ProtocolShareReserve.json" assert { type: "json" };
import vBnbAdminArtifact from "@venusprotocol/venus-protocol/artifacts/contracts/Admin/VBNBAdmin.sol/VBNBAdmin.json" assert { type: "json" };
import vBNB from "@venusprotocol/venus-protocol/artifacts/contracts/Admin/VBNBAdminStorage.sol/VTokenInterface.json" assert { type: "json" };
import diamondComptrollerArtifact from "@venusprotocol/venus-protocol/artifacts/contracts/Comptroller/Diamond/DiamondConsolidated.sol/DiamondConsolidated.json" assert { type: "json" };
import coreVTokenArtifact from "@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VBep20Delegate.sol/VBep20Delegate.json" assert { type: "json" };
import { defineConfig } from "@wagmi/cli";
import { hardhat } from "@wagmi/cli/plugins";

const getExternalContracts = async (): Promise<any> => [

Check failure on line 11 in wagmi.config.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
{
abi: poolLensArtifact.abi,
name: 'PoolLens'
name: "PoolLens",
},
{
abi: diamondComptrollerArtifact.abi,
name: 'CoreComptroller'
name: "CoreComptroller",
},
{
abi: ilComptrollerArtifact.abi,
name: 'IlComptroller'
name: "IlComptroller",
},
{
abi: coreVTokenArtifact.abi,
name: 'CoreVToken'
name: "CoreVToken",
},
{
abi: protocolShareReserveArtifact.abi,
name: 'ProtocolShareReserve'
name: "ProtocolShareReserve",
},
{
abi: vBnbAdminArtifact.abi,
name: 'VBnbAdmin'
name: "VBnbAdmin",
},
{
abi: vBNB.abi,
name: 'vBNB'
}
]
name: "vBNB",
},
];

export default defineConfig(async () => {
const externalContracts = await getExternalContracts()
const externalContracts = await getExternalContracts();
return {
out: 'src/config/abis/generated.ts',
out: "src/config/abis/generated.ts",
contracts: externalContracts,
plugins: [
hardhat({
project: '.',
project: ".",
}),
],
}
})
};
});

0 comments on commit 78af8b5

Please sign in to comment.