Skip to content

Commit 311d09b

Browse files
authored
Biome Format (#266)
1 parent cab5074 commit 311d09b

19 files changed

Lines changed: 70 additions & 85 deletions

File tree

packages/create-sei/biome.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"extends": ["../../biome.json"],
4+
"files": {
5+
"ignoreUnknown": false,
6+
"ignore": ["templates/**"]
7+
}
8+
}

packages/create-sei/src/main.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env node
2-
import inquirer from 'inquirer';
32
import boxen from 'boxen';
3+
import inquirer from 'inquirer';
44

5-
import path from 'path';
6-
import fs from 'fs';
7-
import { fileURLToPath } from 'url';
8-
import { dirname } from 'path';
5+
import fs from 'node:fs';
6+
import path from 'node:path';
7+
import { dirname } from 'node:path';
8+
import { fileURLToPath } from 'node:url';
99
import { Command } from 'commander';
1010

1111
const __filename = fileURLToPath(import.meta.url);
@@ -86,7 +86,7 @@ const promptEVMLibrary = async () => {
8686
};
8787

8888
function isValidDirectoryName(dirName) {
89-
const illegalRe = /[<>:"/\\|?*\x00-\x1F]/g;
89+
const illegalRe = /[<>:"/\\|?*]/g;
9090
const windowsReservedRe = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i;
9191
const trailingRe = /[. ]+$/;
9292
const validNpmPackageRe = /^(?:@[a-z0-9-*~][a-z0-9-*._~]*)?[a-z0-9-~][a-z0-9-._~]*$/;
@@ -95,6 +95,7 @@ function isValidDirectoryName(dirName) {
9595
return false;
9696
}
9797

98+
// Check for illegal characters, Windows reserved names, trailing spaces/dots
9899
if (illegalRe.test(dirName) || windowsReservedRe.test(dirName) || trailingRe.test(dirName) || !validNpmPackageRe.test(dirName)) {
99100
return false;
100101
}
@@ -166,7 +167,7 @@ async function runWizard(options: WizardOptions): Promise<void> {
166167

167168
const appFramework = options.framework || (await promptFramework());
168169
let appConnectionType = options.ecosystem || (await promptRpcIntegrations());
169-
if (appConnectionType == RPCIntegrationType.EVM) {
170+
if (appConnectionType === RPCIntegrationType.EVM) {
170171
appConnectionType = options.library || (await promptEVMLibrary());
171172
}
172173

@@ -182,7 +183,7 @@ async function runWizard(options: WizardOptions): Promise<void> {
182183
program
183184
.command('app')
184185
.description('Create a new SEI dApp')
185-
.option('-n, --name <name>', `Specify the name of your dApp. Name must be a valid package name.`)
186+
.option('-n, --name <name>', 'Specify the name of your dApp. Name must be a valid package name.')
186187
.option('-f, --framework <framework>', `Specify the app framework to use: [${Object.values(FrontendScaffolding).join(', ')}]`)
187188
.option('-e, --ecosystem <ecosystem>', `Specify the ecosystem to use: [${Object.values(RPCIntegrationType).join(', ')}]`)
188189
.option('-l, --library <library>', `Specify the EVM library to use: [${Object.values(EVMLibrary).join(', ')}]. Only used if ecosystem chosen is 'EVM'`)

packages/ledger/package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"module": "./dist/esm/src/index.js",
77
"types": "./dist/types/src/index.d.ts",
88
"sideEffects": false,
9-
"files": [
10-
"dist"
11-
],
9+
"files": ["dist"],
1210
"scripts": {
1311
"build": "rimraf dist && yarn build:cjs && yarn build:esm && yarn build:types",
1412
"build:cjs": "tsc --outDir dist/cjs --module commonjs",
@@ -18,12 +16,7 @@
1816
"test": "jest"
1917
},
2018
"homepage": "https://github.com/sei-protocol/sei-js#readme",
21-
"keywords": [
22-
"sei",
23-
"javascript",
24-
"typescript",
25-
"ledger"
26-
],
19+
"keywords": ["sei", "javascript", "typescript", "ledger"],
2720
"repository": "git@github.com:sei-protocol/sei-js.git",
2821
"license": "MIT",
2922
"publishConfig": {

packages/ledger/src/cosmos/seiLedgerOfflineAminoSigner.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { AminoSignResponse, encodeSecp256k1Signature, OfflineAminoSigner, serializeSignDoc, StdSignDoc } from '@cosmjs/amino';
2-
import { fromHex } from '@cosmjs/encoding';
3-
import { AccountData } from '@cosmjs/proto-signing';
1+
import { type AminoSignResponse, type OfflineAminoSigner, type StdSignDoc, encodeSecp256k1Signature, serializeSignDoc } from '@cosmjs/amino';
42
import { Secp256k1Signature } from '@cosmjs/crypto';
5-
import { SeiApp } from '@zondax/ledger-sei';
3+
import { fromHex } from '@cosmjs/encoding';
4+
import type { AccountData } from '@cosmjs/proto-signing';
5+
import type { SeiApp } from '@zondax/ledger-sei';
66

77
/**
88
* A signer implementation that uses a Ledger device to sign transactions

packages/precompiles/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
"test": "jest --passWithNoTests"
1616
},
1717
"homepage": "https://github.com/sei-protocol/sei-js#readme",
18-
"keywords": [
19-
"sei",
20-
"javascript",
21-
"typescript",
22-
"node",
23-
"evm"
24-
],
18+
"keywords": ["sei", "javascript", "typescript", "node", "evm"],
2519
"repository": "git@github.com:sei-protocol/sei-js.git",
2620
"license": "MIT",
2721
"publishConfig": {

packages/precompiles/src/ethers/addressPrecompile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ContractRunner, Contract, type InterfaceAbi } from 'ethers';
1+
import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
22
import { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } from '../precompiles';
33

44
/**

packages/precompiles/src/ethers/distributionPrecompile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
2-
import { DISTRIBUTION_PRECOMPILE_ADDRESS, DISTRIBUTION_PRECOMPILE_ABI } from '../precompiles';
2+
import { DISTRIBUTION_PRECOMPILE_ABI, DISTRIBUTION_PRECOMPILE_ADDRESS } from '../precompiles';
33

44
/**
55
* The ABI for the Distribution precompile contract, used to create an Ethers contract.

packages/registry/package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"module": "./dist/esm/src/index.js",
77
"types": "./dist/types/src/index.d.ts",
88
"sideEffects": false,
9-
"files": [
10-
"dist"
11-
],
9+
"files": ["dist"],
1210
"scripts": {
1311
"build": "rimraf dist && yarn build:cjs && yarn build:esm && yarn build:types",
1412
"build:cjs": "tsc --outDir dist/cjs --module commonjs",
@@ -18,12 +16,7 @@
1816
"test": "jest"
1917
},
2018
"homepage": "https://github.com/sei-protocol/sei-js#readme",
21-
"keywords": [
22-
"sei",
23-
"javascript",
24-
"typescript",
25-
"registry"
26-
],
19+
"keywords": ["sei", "javascript", "typescript", "registry"],
2720
"repository": "git@github.com:sei-protocol/sei-js.git",
2821
"license": "MIT",
2922
"publishConfig": {

packages/registry/src/gas/__tests__/index.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { ModuleAdjustments, GAS_INFO, ChainGasInfo } from '../index';
2-
import { Network } from '../../index';
1+
import type { Network } from '../../index';
2+
import { type ChainGasInfo, GAS_INFO, type ModuleAdjustments } from '../index';
33

44
describe('GasInfo Tests', () => {
55
// Check if GasInfo contains all expected networks
66
it('contains all required networks', () => {
77
const expectedNetworks: Network[] = ['pacific-1', 'atlantic-2', 'arctic-1'];
8-
expectedNetworks.forEach((network) => {
8+
for (const network of expectedNetworks) {
99
expect(GAS_INFO).toHaveProperty(network);
10-
});
10+
}
1111
});
1212

1313
// Validate the structure of GasInfo for each network
1414
it('validates structure for each network', () => {
15-
Object.values(GAS_INFO).forEach((info: ChainGasInfo) => {
15+
for (const info of Object.values(GAS_INFO)) {
1616
expect(typeof info.denom).toBe('string');
1717
expect(typeof info.min_gas_price).toBe('number');
1818
expect(info).toHaveProperty('module_adjustments');
@@ -22,7 +22,7 @@ describe('GasInfo Tests', () => {
2222
expect(typeof dex.sudo_gas_price).toBe('number');
2323
expect(typeof dex.order_placement).toBe('number');
2424
expect(typeof dex.order_cancellation).toBe('number');
25-
});
25+
}
2626
});
2727

2828
// Example: Check specific values for a network (e.g., 'pacific-1')

packages/registry/src/gas/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import GasInfoJSON from '../../chain-registry/gas.json';
2-
import { Network } from '../index';
2+
import type { Network } from '../index';
33

44
/**
55
* Defines the gas price adjustments for specific modules within the Sei blockchain,

0 commit comments

Comments
 (0)