mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-08-31 02:41:44 +00:00
build: add oxlint, oxfmt, commitlint, lefthook, knip, and editorconfig configs (#23)
## Summary - Install oxlint, oxfmt, commitlint, lefthook, knip as dev dependencies - Add `.oxlintrc.json` (correctness rules + React plugin) - Add `.oxfmtrc.json` (double quotes, semicolons, 2-space indent, trailing commas) - Add `commitlint.config.js` (conventional commits) - Add `lefthook.yml` (pre-commit lint+format, commit-msg commitlint) - Add `.editorconfig` and `knip.config.ts` - Add scripts: `pnpm lint`, `pnpm format`, `pnpm format:check`, `pnpm knip` Part 1/4 of [VA-851](https://linear.app/heygen/issue/VA-851/pre-migration-configure-eslint-prettier-and-conventional-commits) ## Test plan - [x] `pnpm lint` runs (reports pre-existing errors, expected) - [x] `pnpm format:check` runs (reports pre-existing diffs, expected) - [x] `commitlint` validates and rejects messages correctly - [x] lefthook hooks install via `pnpm run prepare` - [x] `pnpm knip` runs
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"singleQuote": false,
|
||||
"semi": true,
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 100
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"categories": {
|
||||
"correctness": "error"
|
||||
},
|
||||
"plugins": ["react", "typescript"],
|
||||
"ignorePatterns": ["dist/", "coverage/", "node_modules/"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { KnipConfig } from "knip";
|
||||
|
||||
const config: KnipConfig = {
|
||||
workspaces: {
|
||||
"packages/cli": {
|
||||
entry: ["src/cli.ts"],
|
||||
},
|
||||
"packages/core": {
|
||||
entry: ["src/index.ts", "src/lint/index.ts", "src/compiler/index.ts"],
|
||||
},
|
||||
"packages/engine": {
|
||||
entry: ["src/index.ts"],
|
||||
},
|
||||
"packages/producer": {
|
||||
entry: ["src/index.ts", "src/server.ts"],
|
||||
},
|
||||
"packages/studio": {
|
||||
entry: ["src/index.ts", "src/styles/tailwind-preset.ts"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,14 @@
|
||||
pre-commit:
|
||||
parallel: true
|
||||
commands:
|
||||
lint:
|
||||
glob: "*.{js,jsx,ts,tsx}"
|
||||
run: oxlint {staged_files}
|
||||
format:
|
||||
glob: "*.{js,jsx,ts,tsx,json,css,md,yaml,yml}"
|
||||
run: oxfmt --check {staged_files}
|
||||
|
||||
commit-msg:
|
||||
commands:
|
||||
commitlint:
|
||||
run: commitlint --edit "{1}"
|
||||
+16
-1
@@ -9,11 +9,26 @@
|
||||
"studio": "pnpm --filter @hyperframes/studio dev",
|
||||
"build:hyperframes-runtime": "pnpm --filter @hyperframes/core build:hyperframes-runtime",
|
||||
"build:hyperframes-runtime:modular": "pnpm --filter @hyperframes/core build:hyperframes-runtime:modular",
|
||||
"set-version": "tsx scripts/set-version.ts"
|
||||
"set-version": "tsx scripts/set-version.ts",
|
||||
"lint": "oxlint .",
|
||||
"lint:fix": "oxlint --fix .",
|
||||
"format": "oxfmt .",
|
||||
"format:check": "oxfmt --check .",
|
||||
"knip": "knip",
|
||||
"prepare": "test -d .git && lefthook install || true"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": ["lefthook"]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^20.5.0",
|
||||
"@commitlint/config-conventional": "^20.5.0",
|
||||
"@types/node": "^25.0.10",
|
||||
"concurrently": "^8.2.0",
|
||||
"knip": "^6.0.3",
|
||||
"lefthook": "^2.1.4",
|
||||
"oxfmt": "^0.41.0",
|
||||
"oxlint": "^1.56.0",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
|
||||
Generated
+1470
-7
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user