Skip to content

Commit

Permalink
chore: re-configure biome, update packages to latest (#238)
Browse files Browse the repository at this point in the history
* chore: re-configure biome, update packages to latest

* chore: dedupe
  • Loading branch information
sozonome authored Sep 10, 2024
1 parent 217b5db commit 7620250
Show file tree
Hide file tree
Showing 105 changed files with 919 additions and 1,026 deletions.
65 changes: 52 additions & 13 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -10,21 +10,32 @@
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": "error",
"useSimplifiedLogicExpression": "error",
"noVoid": "warn"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useHookAtTopLevel": "error"
},
"suspicious": {
"noConsoleLog": "error",
"noEmptyBlockStatements": "error"
"nursery": {
"noConsole": "error",
"noDuplicateElseIf": "error",
"noDuplicateJsonKeys": "error",
"noUnusedFunctionParameters": "error",
"noUselessStringConcat": "error",
"noUselessUndefinedInitialization": "error",
"useDefaultSwitchClause": "error",
"useSemanticElements": "error",
"useTopLevelRegex": "error"
},
"complexity": {
"useSimplifiedLogicExpression": "error",
"noExcessiveCognitiveComplexity": "error",
"noVoid": "warn"
"performance": {
"noBarrelFile": "error"
},
"style": {
"noDefaultExport": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useConsistentArrayType": {
Expand All @@ -33,17 +44,45 @@
"syntax": "generic"
}
},
"useSingleCaseStatement": "error"
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"]
}
}
},
"nursery": {
"noDuplicateElseIf": "error",
"noDuplicateJsonKeys": "error"
"suspicious": {
"noConsoleLog": "error",
"noEmptyBlockStatements": "error",
"useAwait": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
},
"overrides": [
{
"include": ["src/lib/pages/**/index.*", "src/app/**/*", "*.ts"],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
},
{
"include": ["src/app/**/*"],
"linter": {
"rules": {
"performance": {
"noBarrelFile": "off"
}
}
}
}
]
}
102 changes: 102 additions & 0 deletions content/notes/biome-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: Biome Config
description: My personal biome configuration
published: true
date: 2024-09-10
tags:
- config
- biome
---

```json
// biome.json
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"indentStyle": "space"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": "error",
"useSimplifiedLogicExpression": "error",
"noVoid": "warn"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useHookAtTopLevel": "error"
},
"nursery": {
"noConsole": "error",
"noDuplicateElseIf": "error",
"noDuplicateJsonKeys": "error",
"noUnusedFunctionParameters": "error",
"noUselessStringConcat": "error",
"noUselessUndefinedInitialization": "error",
"useDefaultSwitchClause": "error",
"useSemanticElements": "error",
"useTopLevelRegex": "error"
},
"performance": {
"noBarrelFile": "error"
},
"style": {
"noDefaultExport": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useConsistentArrayType": {
"level": "error",
"options": {
"syntax": "generic"
}
},
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"]
}
}
},
"suspicious": {
"noConsoleLog": "error",
"noEmptyBlockStatements": "error",
"useAwait": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [
{
"include": ["src/lib/views/**/index.*", "src/lib/views/**/index.*", "src/app/**/*", "*.ts"],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
},
{
"include": ["src/app/**/*"],
"linter": {
"rules": {
"performance": {
"noBarrelFile": "off"
}
}
}
}
]
}

```
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:coverage": "vitest --coverage",
"start": "next start",
"lint": "pnpm lint:next && pnpm lint:biome",
"biome:apply": "pnpm biome check --apply ./src next.config.js commitlint.*",
"biome:apply": "pnpm biome check --write ./src next.config.js commitlint.*",
"type-check": "tsc --noEmit",
"knip": "knip",
"check:turbo": "pnpm turbo lint type-check",
Expand All @@ -38,19 +38,19 @@
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@giscus/react": "^3.0.0",
"@prisma/client": "^5.17.0",
"@prisma/client": "^5.18.0",
"@t3-oss/env-nextjs": "^0.11.0",
"@vercel/speed-insights": "^1.0.12",
"cmdk": "^1.0.0",
"framer-motion": "^11.3.19",
"framer-motion": "^11.3.28",
"lodash-es": "^4.17.21",
"million": "3.1.11",
"next": "14.2.5",
"next-seo": "^6.5.0",
"nextjs-toploader": "^1.6.12",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-icons": "^5.2.1",
"react-icons": "^5.3.0",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.5.0",
"react-wrap-balancer": "^1.1.1",
Expand All @@ -62,37 +62,37 @@
"swr": "^2.2.5",
"ua-parser-js": "^1.0.38",
"zod": "^3.23.8",
"zustand": "^4.5.4"
"zustand": "^4.5.5"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@commitlint/cli": "^19.3.0",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "19.2.2",
"@commitlint/cz-commitlint": "19.2.0",
"@commitlint/cz-commitlint": "19.4.0",
"@commitlint/types": "^19.0.3",
"@content-collections/core": "^0.6.4",
"@content-collections/next": "^0.2.0",
"@next/bundle-analyzer": "^14.2.5",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.14.12",
"@types/node": "^22.4.1",
"@types/react": "^18.3.3",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/rss": "^0.0.32",
"@types/ua-parser-js": "^0.7.39",
"@vitest/coverage-v8": "^2.0.4",
"@vitest/ui": "^2.0.4",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.5",
"husky": "^9.1.3",
"knip": "^5.27.0",
"lint-staged": "^15.2.7",
"husky": "^9.1.4",
"knip": "^5.27.2",
"lint-staged": "^15.2.9",
"next-sitemap": "^4.2.3",
"prisma": "^5.17.0",
"prisma": "^5.18.0",
"standard-version": "^9.5.0",
"typescript": "^5.5.4",
"vitest": "^2.0.4"
"vitest": "^2.0.5"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 7620250

Please sign in to comment.