chore: quality-tightening (oxfmt + oxlint + tsgo + vitest + husky + CI)#34
Merged
Conversation
Standard rollout for this Tauri + React + Konva map editor. - new: prettier-style formatting via oxfmt (no prior config). - new: oxlint with eslint-plugin-unicorn + react + jsx-a11y plugins. - new: vitest 3 + @vitest/coverage-istanbul + happy-dom + @testing-library/react + @testing-library/jest-dom; the repo had 0 tests before. 14 unit tests covering AssetPath (3 static helpers, edge cases for slashes and prefix stripping) and createObservable (notify fan-out, unsubscribe, Object.isFrozen invariant). - new: tsgo --noEmit (alongside tsc fallback). step-rust-build now uses tsgo too. - new: husky 9 with scripts/ensure-husky.mjs self-heal + lint-staged. Pre-commit additionally runs cargo check on staged Rust/Cargo files (Tauri convention from the playbook). - new: .github/workflows/checks.yml runs Format + Lint + Typecheck + Test on every PR + push. - new: gitleaks, actionlint, shellcheck as mise-managed binaries. Action version updates surfaced by actionlint: - actions/checkout v2/v3 -> v4 (15 instances across ci.yml + release.yml) - actions-rs/toolchain@v1 -> dtolnay/rust-toolchain@stable (the actions-rs/* org is archived) - actions-rs/cargo@v1 -> plain 'run: cargo ...' shell commands Code-level oxlint fixes (kept minimal): - Removed unused imports (HTMLInputTypeAttribute, isSceneOpenState, Transformer). - Prefixed unused parameters with '_' (ExternalLink href, Canvas e, CanvasSprite e/onTransformEnd e). - Dropped unused 'get' destructure in SceneState recoil setter. - useGlobalHotkeys: rewrote 'a ? x() : y()' as if/else (clearer + no-unused-expressions clean). - Modal subtitle ref binding: documented the no-op-looking declaration with an eslint-disable comment (it's set later by react-modal via a callback ref). - Yarn resolutions pin @types/react and @types/react-dom to ^18 to avoid @types/react-modal pulling @types/react@19 transitively. Carve-outs: - src/init.ts polyfills String.prototype.capitaliseFirstLetter; the no-extend-native rule is disabled for that one file. - 13 pre-existing oxlint warnings remain (oxc/no-map-spread, react-hooks/exhaustive-deps where the deps are stable refs, plus jsx-a11y warnings on the canvas overlay). Per playbook trap #22 the lint script drops --deny-warnings. Verified locally: lint 0/13, format clean, typecheck clean, test 14/14, actionlint clean across all workflows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standard rollout for this Tauri + React + Konva map editor. Was missing oxfmt/oxlint/tsgo/vitest/husky and had no JS-side CI (only the rust ci.yml). Repo had 0 tests before.
eslint-plugin-unicorn+ react + jsx-a11y@vitest/coverage-istanbul+happy-dom+@testing-library/react+@testing-library/jest-dom. 14 unit tests coveringAssetPath(3 static helpers, edge cases for slashes and prefix stripping) andcreateObservable(notify fan-out, unsubscribe,Object.isFrozeninvariant).step-rust-buildnow uses tsgo too.scripts/ensure-husky.mjsself-heal + lint-staged. Pre-commit additionally runscargo checkon staged Rust/Cargo files (Tauri convention from the playbook)..github/workflows/checks.ymlruns Format + Lint + Typecheck + Test on every PR + push.Action version updates surfaced by actionlint
actions/checkout@v2/@v3\u2192@v4(15 instances acrossci.yml+release.yml)actions-rs/toolchain@v1\u2192dtolnay/rust-toolchain@stable(the actions-rs/* org is archived)actions-rs/cargo@v1\u2192 plainrun: cargo \u2026shell commandsCode-level oxlint fixes
HTMLInputTypeAttribute,isSceneOpenState,Transformer)._(ExternalLinkhref, Canvase, CanvasSpritee/onTransformEnde).getdestructure in SceneState recoil setter.useGlobalHotkeys: rewrotea ? x() : y()as if/else (clearer +no-unused-expressionsclean).subtitleref binding: documented the no-op-looking declaration with an eslint-disable comment (it's set later by react-modal via a callback ref).@types/reactand@types/react-domto^18to avoid@types/react-modalpulling@types/react@19transitively (which broke the JSX namespace).Carve-outs
src/init.tspolyfillsString.prototype.capitaliseFirstLetter; theno-extend-nativerule is disabled for that one file.--deny-warnings.Verified locally
yarn lint\u2014 0 errors, 13 warningsyarn format:check\u2014 cleanyarn typecheck\u2014 cleanyarn test\u2014 14 / 14actionlint\u2014 clean across all 3 workflows