Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Migrate to biome (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
sz-piotr authored Jul 15, 2024
1 parent 5abc766 commit cddae72
Show file tree
Hide file tree
Showing 37 changed files with 310 additions and 1,377 deletions.
14 changes: 0 additions & 14 deletions .devcontainer/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions .devcontainer/devcontainer.json

This file was deleted.

43 changes: 0 additions & 43 deletions .devcontainer/docker-compose.yml

This file was deleted.

36 changes: 4 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,13 @@ on:
- master

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn build:dependencies
- run: yarn test
env:
COINGECKO_API_KEY: ${{ secrets.COINGECKO_API_KEY }}
TEST_DB_URL: postgresql://postgres:postgres@localhost:5432/postgres
CONFIG_ALCHEMY_API_KEY: ${{ secrets.CONFIG_ALCHEMY_API_KEY }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn build:dependencies
Expand All @@ -53,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn build
Expand All @@ -65,7 +37,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn format
- run: yarn format
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
179 changes: 179 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"files": {
"ignore": ["node_modules/", "build/", "dist/"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto"
},
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noStaticOnlyClass": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noWith": "error"
},
"correctness": {
"noUnusedImports": "error",
"noConstAssign": "error",
"noConstantCondition": "off",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "error",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"style": {
"useForOf": "error",
"noDefaultExport": "error",
"noNamespace": "error",
"noNonNullAssertion": "error",
"useAsConstAssertion": "error",
"useLiteralEnumMembers": "error"
},
"performance": {
"noAccumulatingSpread": "error",
"noDelete": "error"
},
"nursery": {
"noDuplicateElseIf": "error",
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"console": "Do not use console"
}
}
},
"useSortedClasses": {
"level": "error",
"options": {
"attributes": ["className", "classname"],
"functions": ["cn", "cva"]
}
}
},
"suspicious": {
"noAssignInExpressions": "off",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCompareNegZero": "error",
"noConfusingVoidType": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "off",
"noExplicitAny": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useAwait": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "all",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
},
"jsxRuntime": "reactClassic"
},
"overrides": [
{
"include": ["src/**/*.stories.ts", "src/**/*.tsx"],
"linter": { "rules": { "style": { "noDefaultExport": "off" } } }
},
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
}
]
}
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"license": "MIT",
"engines": {
"node": "^16.0.0",
"node": "^18.0.0",
"yarn": ">=1.22.0 <2"
},
"workspaces": {
Expand All @@ -25,27 +25,18 @@
"lint:fix": "wsrun -ecam lint:fix",
"lint": "wsrun -ecam lint",
"start": "cd packages/backend && yarn start",
"test": "wsrun -ecam test",
"typecheck": "wsrun -ecam typecheck"
},
"devDependencies": {
"@biomejs/biome": "1.7.0",
"@sinonjs/fake-timers": "^9.1.2",
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.41",
"@types/sinonjs__fake-timers": "^8.1.2",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"earljs": "^0.2.3",
"esbuild": "^0.14.43",
"esbuild-register": "^3.3.3",
"eslint": "^8.24.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-no-only-tests": "^3.0.0",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"mocha": "^10.0.0",
"prettier": "^2.6.2",
"typescript": "^4.9.3",
"wait-for-expect": "^3.0.2",
"wsrun": "^5.2.4"
Expand Down
Loading

0 comments on commit cddae72

Please sign in to comment.