Skip to content

Commit 1384dbf

Browse files
committed
chore: quality-tightening (yarn 1 -> 4, oxfmt + oxlint + tsc + vitest + husky)
Yarn 1 -> 4 migration plus the standard quality-tightening rollout. - Drops yarn 1 lockfile + .yarnrc; adds .yarnrc.yml + mise.toml (node 20.18.0, yarn 4.14.1, actionlint, shellcheck, gitleaks). - prettier -> oxfmt - eslint (with @typescript-eslint, github, jest, prettier, unicorn) -> oxlint with eslint-plugin-unicorn - jest 26 + jest-circus + jest-fail-on-console + ts-jest + @types/jest -> vitest 4 + vite 7 + @vitest/coverage-istanbul. jest.config.js + jest.setup.ts removed; replaced with vitest.config.mts + src/test/setup.ts. - new: tsgo --noEmit (alongside tsc fallback) - husky 7 -> husky 9 with scripts/ensure-husky.mjs self-heal + lint-staged - yarn-audit-fix dropped (yarn 4 has its own audit; the fixer was yarn 1 specific) - ts-node dropped (not used by build/test/lint) - TypeScript bumped 4.x -> 5; tsconfig target ES6 -> ES2022 + lib ES2022 + DOM, skipLibCheck on, types: [node]. - Added standard yarn 4 .gitignore entries (.yarn/cache et al.) Test migration (10 files): - Bulk-converted jest.* -> vi.* and added vitest imports. - 2 tests asserted nothing: 'expect(() => fn()).rejects;' (no matcher chained). Replaced with proper 'await expect(fn()).rejects.toThrow(...)' assertions, per the global rule 'Never weaken a test to make it pass'. - jest.setup.ts (jest-fail-on-console) replaced with src/test/setup.ts that installs equivalent console-fail spies in beforeEach + restores in afterEach. Same 'console output = failed test' behaviour. Verified locally: lint 0/6, format clean, typecheck clean, test 77/78 (1 pre-existing skipped), build succeeds (ncc bundle 2282kB), actionlint clean across all workflows.
1 parent 9e9fb99 commit 1384dbf

39 files changed

Lines changed: 35528 additions & 13655 deletions

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,12 @@
22
node_modules
33
coverage/
44
lib/
5+
6+
# Yarn 4 (Berry)
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/sdks
12+
!.yarn/versions
13+
.pnp.*

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
if [ -t 1 ]; then
5-
exec < /dev/tty
6-
fi
7-
1+
#!/usr/bin/env sh
82
yarn lint-staged
9-
yarn lint
10-
yarn test
3+
yarn typecheck
114

12-
yarn build
13-
git add dist
5+
if command -v gitleaks >/dev/null 2>&1; then
6+
gitleaks protect --staged --no-banner --redact
7+
fi

.oxfmtrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 100,
6+
"proseWrap": "preserve",
7+
"sortPackageJson": false,
8+
"ignorePatterns": [
9+
"**/node_modules/**",
10+
"**/dist/**",
11+
"**/coverage/**",
12+
"**/.yarn/**",
13+
"default-build-script/**",
14+
"test-runner/**",
15+
"platforms/**"
16+
]
17+
}

.oxlintrc.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "vitest", "unicorn", "oxc"],
4+
"categories": {
5+
"correctness": "error",
6+
"suspicious": "error",
7+
"perf": "error"
8+
},
9+
"rules": {
10+
"vitest/require-mock-type-parameters": "off",
11+
"vitest/valid-title": "off",
12+
"vitest/valid-describe-callback": "off",
13+
"vitest/expect-expect": "off",
14+
"vitest/no-conditional-tests": "off",
15+
"vitest/no-conditional-expect": "off",
16+
"vitest/require-to-throw-message": "off",
17+
"vitest/no-disabled-tests": "warn",
18+
"unicorn/prefer-array-flat-map": "warn",
19+
"typescript/no-explicit-any": "warn",
20+
"typescript/ban-ts-comment": "off",
21+
"typescript/no-namespace": "off",
22+
"typescript/no-extraneous-class": "off",
23+
"no-bitwise": "off",
24+
"no-shadow": "off",
25+
"no-await-in-loop": "off",
26+
"no-underscore-dangle": "off",
27+
"unicorn/no-array-sort": "off",
28+
"unicorn/prefer-set-has": "off",
29+
"unicorn/consistent-function-scoping": "off",
30+
"unicorn/no-useless-spread": "warn",
31+
"eslint/preserve-caught-error": "warn",
32+
"oxc/no-map-spread": "warn"
33+
},
34+
"overrides": [
35+
{
36+
"files": ["**/*.test.ts", "**/*.spec.ts"],
37+
"rules": {
38+
"typescript/no-explicit-any": "off",
39+
"no-unused-vars": "off"
40+
}
41+
}
42+
],
43+
"env": {
44+
"browser": false,
45+
"node": true,
46+
"es2024": true,
47+
"vitest/globals": true
48+
},
49+
"ignorePatterns": [
50+
"**/node_modules/**",
51+
"**/dist/**",
52+
"**/coverage/**",
53+
"**/.yarn/**",
54+
"default-build-script/**",
55+
"test-runner/**",
56+
"platforms/**"
57+
]
58+
}

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.yarnrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)