Skip to content

Commit

Permalink
Merge pull request #63 from ChiefORZ/refactor/adopt-biomejs-formatting
Browse files Browse the repository at this point in the history
refactor: adopt biomejs formatting
  • Loading branch information
ChiefORZ authored Dec 4, 2023
2 parents 6589d43 + dec0beb commit f74dc66
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 355 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v1


- name: Build
run: pnpm run build

- name: Format check
run: pnpm run format:check

- name: Test
run: pnpm run test

Expand All @@ -65,6 +67,6 @@ jobs:
BEFORE: ${{ github.event.before }}
SHA: ${{ github.sha }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABEL: '// TODO'
COMMENT_MARKER: '//'
LABEL: "// TODO"
COMMENT_MARKER: "//"
id: todo
5 changes: 2 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
"biomejs.biome",
"dbaeumer.vscode-eslint"
]
}
39 changes: 39 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": false
},
"files": {
"ignoreUnknown": true
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"ignore": ["**/.next", "**/.wireit", "**/build", "**/dist", "**/node_modules"]
},
"javascript": {
"formatter": {
"enabled": true,
"quoteStyle": "single",
"arrowParentheses": "always",
"trailingComma": "all",
"lineEnding": "lf"
}
},
"json": {
"formatter": {
"enabled": true
}
}
}
40 changes: 15 additions & 25 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
{
"entry": [
"bin/*.ts",
"src/index.ts"
],
"ignore": [
"src/createFunctionWaitForIdleNetwork.ts"
],
"ignoreDependencies": [
"@chieforz/prettier-config",
"@types/conventional-changelog",
"@types/semver",
"conventional-changelog",
"conventional-changelog-conventionalcommits",
"husky",
"lint-staged",
"npm-run-all",
"semver",
"prettier-plugin-packagejson",
"prettier-plugin-tailwindcss"
],
"project": [
"src/**/*.ts",
"src/**/*.tsx"
]
}
"entry": ["bin/*.ts", "src/index.ts"],
"ignore": ["src/createFunctionWaitForIdleNetwork.ts"],
"ignoreDependencies": [
"@chieforz/biome-config",
"@types/conventional-changelog",
"@types/semver",
"conventional-changelog",
"conventional-changelog-conventionalcommits",
"husky",
"lint-staged",
"npm-run-all",
"semver"
],
"project": ["src/**/*.ts", "src/**/*.tsx"]
}
117 changes: 53 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,77 +10,18 @@
"scripts": {
"build": "wireit",
"dev": "wireit",
"format:check": "wireit",
"format:write": "wireit",
"lint": "wireit",
"precommit": "wireit",
"prepare": "wireit",
"release": "wireit",
"test": "wireit",
"test:knip": "wireit"
},
"wireit": {
"build": {
"command": "tsc",
"files": [
"src/**/*",
"tsconfig.json"
],
"clean": true,
"output": [
"dist/**"
]
},
"dev": {
"command": "node --import tsx --watch ./bin/pdf-generator",
"files": [
"src/**/*",
"bin/pdf-generator"
],
"service": true
},
"lint": {
"command": "eslint './src/**/*.{js,jsx,ts,tsx}' --fix",
"files": [
"src/**/*"
],
"output": []
},
"precommit": {
"command": "lint-staged",
"files": [
"src/**/*"
],
"output": []
},
"prepare": {
"command": "husky install"
},
"release": {
"command": "release-it",
"files": [
"src/**/*",
"package.json"
],
"output": []
},
"test": {
"command": "npm-run-all test:*",
"files": [
"src/**/*"
],
"output": []
},
"test:knip": {
"command": "knip",
"files": [
"src/**/*"
],
"output": []
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix"
},
"prettier": "@chieforz/prettier-config",
"eslintConfig": {
"extends": "@chieforz/eslint-config-tslint-base"
},
Expand All @@ -98,8 +39,9 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@chieforz/biome-config": "^1.2.3",
"@chieforz/eslint-config-tslint-base": "^1.2.3",
"@chieforz/prettier-config": "^1.2.3",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@release-it/conventional-changelog": "^8.0.1",
Expand All @@ -116,8 +58,6 @@
"knip": "^2.43.0",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"prettier-plugin-packagejson": "^2.4.7",
"prettier-plugin-tailwindcss": "^0.5.7",
"release-it": "^17.0.0",
"semver": "^7.5.4",
"wireit": "^0.14.1"
Expand All @@ -128,5 +68,54 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"wireit": {
"build": {
"command": "tsc",
"files": ["src/**/*", "tsconfig.json"],
"clean": true,
"output": ["dist/**"]
},
"dev": {
"command": "node --import tsx --watch ./bin/pdf-generator",
"files": ["src/**/*", "bin/pdf-generator"],
"service": true
},
"format:check": {
"command": "biome check ./src",
"files": ["src/**/*.{js,jsx,ts,tsx}"],
"output": []
},
"format:write": {
"command": "biome check --apply ./src"
},
"lint": {
"command": "eslint './src/**/*.{js,jsx,ts,tsx}' --fix",
"files": ["src/**/*"],
"output": []
},
"precommit": {
"command": "lint-staged",
"files": ["src/**/*"],
"output": []
},
"prepare": {
"command": "husky install"
},
"release": {
"command": "release-it",
"files": ["src/**/*", "package.json"],
"output": []
},
"test": {
"command": "npm-run-all test:*",
"files": ["src/**/*"],
"output": []
},
"test:knip": {
"command": "knip",
"files": ["src/**/*"],
"output": []
}
}
}
Loading

0 comments on commit f74dc66

Please sign in to comment.