Skip to content

Commit

Permalink
chore: use of biome
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Apr 8, 2024
1 parent 3d3fdfd commit 7ab3d93
Show file tree
Hide file tree
Showing 16 changed files with 581 additions and 479 deletions.
6 changes: 6 additions & 0 deletions .changeset/strange-peaches-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@stijnvanhulle/template-core": minor
"@stijnvanhulle/template-demo": minor
---

use of biome
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.3/schema.json",
"extends": ["@stijnvanhulle/biome-config/biome"]
}
2 changes: 2 additions & 0 deletions configs/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
test: {
Expand All @@ -23,4 +24,5 @@ export default defineConfig({
],
},
},
plugins: [tsconfigPaths()],
})
37 changes: 17 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@
"packages": [
"packages/*",
"packages/config/eslint-config/*",
"packages/config/biome-config/*",
"packages/config/tsup-config/*",
"packages/config/ts-config/*"
]
},
"scripts": {
"build": "turbo run build --filter=./packages/*",
"clean": "turbo run clean",
"format": "bun run format:dprint",
"format:dprint": "dprint fmt",
"format:fix": "dprint fmt --incremental=false",
"format:pack": "npx sort-package-json package.json packages/**/**/package.json",
"format:prettier": "prettier --config ./configs/prettier.config.cjs --write .",
"graph": "npx nx graph ",
"install:csb": "corepack enable && pnpm install --frozen-lockfile",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint --format pretty ./packages/*",
"format": "bun biome format --write ./ && bun format:pack",
"format:pack": "npx sort-package-json package.json",
"lint": "bun biome lint .",
"lint:case": "npx case-police --fix",
"lint:ci": "ESLINT_USE_FLAT_CONFIG=true eslint --max-warnings 10 --format pretty ./packages/*",
"lint:fix": "ESLINT_USE_FLAT_CONFIG=true eslint --fix --format pretty ./packages/* && bun run lint:case",
"lint:ci": "bun biome lint .",
"lint:fix": "bun biome lint --apply-unsafe . && bun run lint:case",
"lint:turbo": "turbo run lint",
"version": "changeset version",
"release": "changeset publish",
Expand All @@ -49,22 +47,21 @@
"//changeset:beta:exit": "changeset pre exit"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@biomejs/biome": "^1.6.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@stijnvanhulle/eslint-config": "workspace:*",
"@stijnvanhulle/biome-config": "workspace:*",
"@stijnvanhulle/ts-config": "workspace:*",
"@types/node": "^20.10.4",
"@vitest/coverage-v8": "^0.34.6",
"@vitest/ui": "^0.34.7",
"bun-types": "^1.0.17",
"dprint": "^0.41.0",
"prettier": "^3.1.1",
"prettier-eslint": "^16.1.2",
"@types/node": "^20.12.5",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"bun-types": "^1.1.3",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"turbo": "^1.11.2",
"typescript": "^5.3.3",
"vitest": "^0.34.6"
"turbo": "^1.13.2",
"typescript": "^5.4.4",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.4.0"
},
"packageManager": "pnpm@8.3.0",
"engines": {
Expand Down
63 changes: 63 additions & 0 deletions packages/config/biome-config/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["__snapshots__", "e2e/schemas", "coverage", "assets", "public", "dist", "artifacts", ".next", ".github", ".codesandbox", ".devcontainer"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 160,
"lineEnding": "lf"
},
"linter": {
"enabled": true,
"rules": {
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "warn",
"noShadowRestrictedNames": "off",
"noConfusingVoidType": "off"
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "off",
"useArrowFunction": "off",
"useLiteralKeys": "off"
},
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"correctness": {
"noEmptyPattern": "off",
"noConstructorReturn": "off",
"noUnsafeOptionalChaining": "off"
},
"performance": {
"noAccumulatingSpread": "off"
}
}
},
"javascript": {
"formatter": {
"enabled": true,
"trailingComma": "all",
"semicolons": "asNeeded",
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"bracketSameLine": false
}
},
"json": {
"formatter": {
"enabled": true
},
"parser": {
"allowComments": true
}
}
}
12 changes: 12 additions & 0 deletions packages/config/biome-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@stijnvanhulle/biome-config",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
"./biome": "./biome.json"
},
"files": [
"biome.json"
]
}
42 changes: 42 additions & 0 deletions packages/config/biome-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"files": [],
"references": [
{
"path": "../../cli"
},
{
"path": "../../core"
},
{
"path": "../../swagger"
},
{
"path": "../../swagger-client"
},
{
"path": "../../swagger-faker"
},
{
"path": "../../swagger-msw"
},
{
"path": "../../swagger-tanstack-query"
},
{
"path": "../../swagger-ts"
},
{
"path": "../../swagger-zod"
},
{
"path": "../../swagger-zodios"
},
{
"path": "../../parser"
},
{
"path": "../../react"
}
]
}
11 changes: 3 additions & 8 deletions packages/config/ts-config/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@
"allowImportingTsExtensions": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"noErrorTruncation": true,
"baseUrl": ".",
"types": [
"vitest/globals",
"bun-types"
]
"types": ["vitest/globals", "bun-types"]
},
"exclude": [
"**/node_modules",
"**/types/**"
]
"exclude": ["**/node_modules", "**/types/**"]
}
5 changes: 4 additions & 1 deletion packages/config/ts-config/bundler.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"display": "Bundler",
"compilerOptions": {
/* If NOT transpiling with TypeScript: */
"module": "ES2020",
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"declaration": false,
"declarationMap": false
}
}
2 changes: 1 addition & 1 deletion packages/config/ts-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"bundler.json"
],
"devDependencies": {
"typescript": "^5.3.3"
"typescript": "^5.4.4"
}
}
10 changes: 5 additions & 5 deletions packages/config/tsup-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
"scripts": {
"build": "tsup",
"clean": "npx rimraf ./dist",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint --format pretty .",
"lint-fix": "bun run lint --quiet --fix",
"lint": "bun biome lint .",
"lint:fix": "bun biome lint --apply-unsafe .",
"release": "pnpm publish --no-git-check",
"release:canary": "bash ../../../.github/canary.sh && node ../../../scripts/build.js canary && pnpm publish --no-git-check",
"start": "tsup --watch",
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
},
"devDependencies": {
"@stijnvanhulle/ts-config": "workspace:*",
"@types/node": "^20.10.4",
"tsup": "^8.0.1"
"@types/node": "^20.12.5",
"tsup": "^8.0.2"
},
"peerDependencies": {
"tsup": "^8.0.0"
"tsup": "^8.0.2"
},
"packageManager": "pnpm@8.3.0",
"engines": {
Expand Down
11 changes: 5 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,20 @@
"scripts": {
"build": "tsup",
"clean": "npx rimraf ./dist",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint --format pretty .",
"lint-fix": "bun run lint --quiet --fix",
"lint": "bun biome lint .",
"lint:fix": "bun biome lint --apply-unsafe .",
"release": "pnpm publish --no-git-check",
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
"start": "tsup --watch",
"test": "vitest --passWithNoTests",
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
},
"devDependencies": {
"@stijnvanhulle/eslint-config": "workspace:*",
"@stijnvanhulle/biome-config": "workspace:*",
"@stijnvanhulle/ts-config": "workspace:*",
"@stijnvanhulle/tsup-config": "workspace:*",
"eslint": "^8.55.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"tsup": "^8.0.2",
"typescript": "^5.4.4"
},
"packageManager": "pnpm@8.3.0",
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"types": [
"vitest/globals",
"bun-types",
Expand Down
11 changes: 5 additions & 6 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"scripts": {
"build": "tsup",
"clean": "npx rimraf ./dist",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint --format pretty .",
"lint-fix": "bun run lint --quiet --fix",
"lint": "bun biome lint .",
"lint:fix": "bun biome lint --apply-unsafe .",
"release": "pnpm publish --no-git-check",
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
"start": "tsup --watch",
Expand All @@ -42,12 +42,11 @@
"@stijnvanhulle/template-core": "workspace:*"
},
"devDependencies": {
"@stijnvanhulle/eslint-config": "workspace:*",
"@stijnvanhulle/biome-config": "workspace:*",
"@stijnvanhulle/ts-config": "workspace:*",
"@stijnvanhulle/tsup-config": "workspace:*",
"eslint": "^8.55.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"tsup": "^8.0.2",
"typescript": "^5.4.4"
},
"packageManager": "pnpm@8.3.0",
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"types": [
"vitest/globals",
"bun-types",
Expand Down
Loading

0 comments on commit 7ab3d93

Please sign in to comment.