Skip to content

Commit

Permalink
chore: add biome as linter/formatter (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck authored Feb 5, 2024
1 parent 5c3269d commit 3eda4a0
Show file tree
Hide file tree
Showing 209 changed files with 4,264 additions and 4,265 deletions.
31 changes: 0 additions & 31 deletions .eslintignore

This file was deleted.

61 changes: 0 additions & 61 deletions .eslintrc.js

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'PR Checks'
name: "PR Checks"

on:
pull_request:
Expand Down Expand Up @@ -47,6 +47,5 @@ jobs:

- name: Run lint & ts:check
run: |
pnpm build
pnpm lint:check
pnpm lint:ci
pnpm ts:check
3 changes: 1 addition & 2 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export default {
'**/*.(js|jsx|ts|jsx|md|mdx|json|html|css)': ['prettier --write'],
'**/*.ts?(x)': ['eslint'],
'**/*.(js|jsx|ts|tsx|md|json|mdx|html|css)': ['biome check --apply-unsafe'],
};
5 changes: 3 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ save-workspace-protocol=rolling
public-hoist-pattern[]=*tailwind-variants*
public-hoist-pattern[]=*framer-motion*
public-hoist-pattern[]=*@react-aria/interactions*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*ts-node*
public-hoist-pattern[]=@types*
public-hoist-pattern[]=*viem*
public-hoist-pattern[]=*wagmi*
public-hoist-pattern[]=*ethers*
25 changes: 0 additions & 25 deletions .prettierignore

This file was deleted.

17 changes: 0 additions & 17 deletions .prettierrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"biomejs.biome",
"statelyai.stately-vscode",
"firsttris.vscode-jest-runner",
"rust-lang.rust-analyzer",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
Expand Down
80 changes: 80 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "warn",
"noImplicitAnyLet": "warn",
"noArrayIndexKey": "off",
"noConfusingVoidType": "off",
"noSelfCompare": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
},
"complexity": {
"noStaticOnlyClass": "off",
"noForEach": "warn",
"noBannedTypes": "off"
},
"performance": {
"noAccumulatingSpread": "off"
},
"a11y": {
"noSvgWithoutTitle": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"json": {
"parser": {
"allowTrailingCommas": true
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignore": [
"**/node_modules",
"**/.turbo",
"**/.next",
"**/.vercel",
"**/dist",
"**/build",
"**/fuel-v2-contracts",
"**/coverage",
"**/generated",
"**/storybook-static",
"*.typegen.ts",
"./packages/app-explorer/public/storybook",
"./packages/app-explorer/public/ui",
"./packages/app-explorer/public/portal",
"./packages/app-explorer/public/portal-storybook",
"./packages/app-portal/public/**",
"./packages/app-portal/src/types",
"pnpm-lock.yaml"
]
}
}
4 changes: 2 additions & 2 deletions contracts/predicate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"license": "ISC",
"devDependencies": {
"dotenv": "16.4.1",
"fuels": "0.71.1",
"vitest": "1.2.1",
"fuels": "0.73.0",
"vitest": "1.2.2",
"tsx": "4.7.0"
}
}
8 changes: 5 additions & 3 deletions contracts/predicate/scripts/run-predicate.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from 'fuels';
import { promises as fs } from 'node:fs';
import { resolve } from 'node:path';
import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from 'fuels';

const { FUEL_PROVIDER, PRIVATE_KEY } = process.env;
const BIN_PATH = resolve(__dirname, '../out/debug/predicate-app.bin');
const AMOUNT = 300_000;

if (!FUEL_PROVIDER || !PRIVATE_KEY) {
throw new Error('Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY');
throw new Error(
'Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY',
);
}

async function main() {
Expand Down Expand Up @@ -43,7 +45,7 @@ async function main() {
BaseAssetId,
{
gasPrice,
}
},
);
const res2 = await tx2.waitForResult();
console.log(`→ Transaction Id: ${res2.id}`);
Expand Down
4 changes: 2 additions & 2 deletions docker/erc20-deployer/deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"dependencies": {
"@fuel-bridge/test-utils": "next",
"ethers": "5.7.2",
"fuels": "0.71.1"
"fuels": "0.73.0"
},
"devDependencies": {
"ts-node": "^10.9.1"
"ts-node": "^10.9.2"
}
}
6 changes: 3 additions & 3 deletions docker/erc20-deployer/deployer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createServer } from 'http';
import {
getOrDeployECR20Contract,
getOrDeployFuelTokenContract,
getTokenId,
setupEnvironment,
} from '@fuel-bridge/test-utils';
import { createServer } from 'http';

const {
PORT,
Expand Down Expand Up @@ -32,7 +32,7 @@ async function main() {
gasPrice: 1,
gasLimit: 1_000_000,
},
9
9,
);
const tokenId = getTokenId(FuelToken);
await startServer({
Expand All @@ -44,7 +44,7 @@ async function main() {

function startServer(deployments: Record<string, string>) {
return new Promise((resolve) => {
createServer(function (req, res) {
createServer((req, res) => {
switch (req.url) {
case '/health':
res.writeHead(200, { 'Content-Type': 'text/plain' });
Expand Down
2 changes: 1 addition & 1 deletion docker/l1-chain/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HardhatUserConfig } from 'hardhat/types';
import '@nomiclabs/hardhat-etherscan';
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-typechain';
import type { HardhatUserConfig } from 'hardhat/types';

const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || '';
const LOCALHOST_HTTP = process.env.LOCALHOST_HTTP || '';
Expand Down
2 changes: 1 addition & 1 deletion docker/l1-chain/hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"license": "MIT",
"dependencies": {
"dotenv": "^10.0.0",
"hardhat": "^2.9.6"
"hardhat": "^2.19.5"
}
}
Loading

0 comments on commit 3eda4a0

Please sign in to comment.