chore: add eslint, clear its findings, and stop a test writing a debug artifact - #57
Merged
Merged
Conversation
…I on it The project had no linter of any kind — no eslint/prettier/biome config and no lint script — despite CONTRIBUTING.md and agents.md both telling contributors to "follow the existing code style". Nothing mechanical enforced that. Adds ESLint 9 (flat config) with eslint-plugin-vue, typescript-eslint and @vue/eslint-config-typescript, plus `lint` / `lint:fix` scripts and a Lint step in CI ahead of typecheck. Retrofitting a linter onto an existing codebase surfaces a backlog, so the severities are deliberate rather than default: - `lint` runs with `--max-warnings 268`, the current count. Warnings are visible and cannot grow, but do not block today. - Four vue rules flag genuine pre-existing defects whose fixes would change runtime behaviour, so they are warnings pending triage, each annotated in the config with its site: vue/require-v-for-key, vue/no-use-v-if-with-v-for, vue/no-dupe-keys and vue/no-mutating-props. - no-explicit-any is a warning; the resolver/schema seams intentionally use `any` where FormKit's own types bottom out. Errors are at zero, so CI blocks on any new error from day one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Applies `eslint --fix` and clears every remaining error so CI can gate on
errors from day one.
- Removes 13 unused imports and 14 unused bindings across src and tests.
- `vue/recommended` includes template formatting rules, so the SFCs are
reformatted (attribute wrapping and indentation). Presentational only.
- Replaces four bare `//@ts-ignore` with `//@ts-expect-error` plus a
description of why the suppression is needed. All four still suppress a
real error, confirmed by vue-tsc.
- Rewrites a `&&` short-circuit used as a statement as an `if` in
demo-content.ts.
Also removes a leftover `writeFileSync("hello.txt", wrapper.html())` debug
line from CraftStaticRenderer.spec.ts. Every test run was dropping a
hello.txt in the repo root, which is why the file had earned a permanent
.gitignore entry — that entry is now removed too, along with the artifact.
Verified: lint, typecheck and build all exit 0; 180/180 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 1.1.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Closes the remaining findings from the repository health review.
1. Add a linter (
c76f2b6)The project had no linter of any kind — no eslint/prettier/biome config, no lint script — despite
CONTRIBUTING.md:131andagents.md:148both instructing contributors to "follow the existing code style". Nothing mechanical enforced it across 22 SFCs and 50 TS files.Adds ESLint 9 flat config with
eslint-plugin-vue,typescript-eslintand@vue/eslint-config-typescript, pluslint/lint:fixscripts and a Lint step in CI ahead of typecheck.Retrofitting a linter surfaces a backlog, so severities are deliberate rather than default:
npm run lintruns with--max-warnings 268— the current count. Warnings stay visible and cannot grow, but don't block today.no-explicit-anyis a warning: the resolver/schema seams intentionally useanywhere FormKit's own types bottom out.2. Clear the findings (
6bb2eb1)srcandtests.//@ts-ignorewith//@ts-expect-errorplus a description. All four still suppress a real error — confirmed, sincets-expect-erroritself fails when there's nothing to suppress.&&short-circuit used as a statement as anif.vue/recommendedincludes formatting rules, so the SFCs got reflowed (attribute wrapping, indentation). This is the bulk of the diff and is presentational only.3. The
hello.txtmystery, solvedhello.txthad a permanent.gitignoreentry. The cause was a leftover debug line in a test:Every test run — including every CI run — was writing a file into the repo root. Removed the line, its
fsimport, the.gitignoreentry, and the artifact.The linter surfaced four genuine bugs. Fixing them changes runtime behaviour, which doesn't belong in a "add a linter" PR, so each is a warning annotated with its site in
eslint.config.js, pending triage:vue/no-dupe-keysCraftIframe.vue:84inheritStylesand a functionconst inheritStylesshare one name — they collide in template scopevue/no-mutating-propsCraftNodeStatic.vue:145setNodeRuntimePropswrites directly into thenodeRuntimePropsprop objectvue/require-v-for-keyCraftEditorBlueprintsList.vue:3v-foroverblueprints.groupswith no:keyvue/no-use-v-if-with-v-forCraftFrame.vue:16,22,30,36v-ifon the same element asv-forPromote these back to
erroronce fixed.Verification
npm run lint— exit 0npm run typecheck— exit 0npm run build— exit 0npm test— 180/180 passing🤖 Generated with Claude Code