Restore working lint setup and fix Playwright cold-start flake - #71
Merged
Conversation
Two pre-existing breakages. `npm run lint` failed with `command "lint" does not exist`: the script survived but the eslint plugin and config were never committed. The `eslint-disable` comments scattered through src/ (no-console, no-await-in-loop, no-unused-expressions) show the code was written against the Vue CLI airbnb preset, so restore exactly that: eslint + @vue/cli-plugin-eslint + @vue/eslint-config-airbnb + @vue/eslint-config-typescript. That surfaced 4324 problems. ~4000 were linebreak-style complaining that a Windows checkout is CRLF, which is unwinnable cross-platform once git normalizes EOLs, so that rule is off. Of the 356 real ones, --fix handled 98 (formatting only, no semantics). The rest split into rules that fight deliberate patterns and genuine defects. Rules switched off, each commented in .eslintrc.js: no-underscore-dangle (Vue 2 skips reactivity for `_` keys, which is how SelectStep holds large track arrays cheaply - renaming would silently tank performance), no-await-in-loop (scrobbling is sequential on purpose because Last.fm rate-limits), no-promise-executor-return (the setTimeout sleep idiom used for backoff), plus no-plusplus/no-continue/ class-methods-use-this/for-of. no-useless-constructor is swapped for its TS-aware version, which understands parameter properties. Genuine fixes: LastFm.makeRequest no longer writes api_key/sk/api_sig back into the caller's params object, and throws instead of falling out of the retry loop returning undefined; parenthesised three `a * b / c` expressions; dropped the dead empty postScrobble and Home.vue's unused component registration; corrected an import that carried a .ts extension. The accessibility findings were real and are fixed rather than silenced: alt text on both images, and keyboard access (role, tabindex, keydown) for the drop zone and the "Not you?" control, plus aria-labels on the visually hidden file inputs. Lint now reports 0 errors and runs in CI as `lint:check` (--no-fix, so the auto-fixer can't let CI pass silently). Separately, the Playwright webServer waited on the TCP port, but vue-cli-service accepts connections before webpack's first compile finishes. Tests started against a still-building server and the first navigation absorbed the ~29s compile inside its own 30s timeout, so `Home Page > renders home page with instructions` failed on cold starts. Wait on a URL instead, which keeps that wait in the webServer timeout. It has to be the publicPath (/scrobblify/) - `/` only resolves via the dev server's history fallback for browser requests and 404s otherwise. That test now takes 5.4s. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b05530b-b27b-45e9-85d5-95b55f19c418
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.
Fixes the two pre-existing issues called out in #70.
1.
npm run lintwas brokenIt failed with
command "lint" does not exist- the script survived but the eslint plugin and config were never committed. Theeslint-disablecomments insrc/(no-console,no-await-in-loop,no-unused-expressions) show the code was written against the Vue CLI airbnb preset, so this restores exactly that toolchain.That surfaced 4324 problems. ~4000 were
linebreak-styleobjecting that a Windows checkout is CRLF - unwinnable cross-platform once git normalizes EOLs, so that rule is off. Of the 356 real ones,--fixhandled 98 (formatting only, no semantics).The remainder split two ways.
Rules turned off because they fight deliberate patterns (each commented in
.eslintrc.js):no-underscore-dangle- Vue 2 skips reactivity for keys starting with_, which is howSelectStepholds large track arrays cheaply. Renaming those fields would silently make them reactive and tank performance on big histories. This one is load-bearing.no-await-in-loop- scrobbling is sequential on purpose; Last.fm rate-limits and each request must settle before the next.no-promise-executor-return- thenew Promise((r) => setTimeout(r, ms))sleep idiom used for backoff.no-plusplus,no-continue,class-methods-use-this, for-of.no-useless-constructorswapped for the TS-aware version, which understands parameter properties instead of flagging them as empty.Genuine defects, fixed:
LastFm.makeRequestwroteapi_key/sk/api_sigback into the caller''s params object; it now signs a copy. It also fell out of the retry loop returningundefinedinstead of throwing.a * b / cexpressions.postScrobbleandHome.vue''s unused component registration; fixed an import carrying a.tsextension.role/tabindex/keydown) for the drop zone and the "Not you?" control, and aria-labels on the visually hidden file inputs.Lint reports 0 errors (82 warnings, mostly
no-explicit-any, which don''t fail the build) and now runs in CI aslint:check---no-fix, so the auto-fixer can''t let CI pass silently.2. Playwright cold-start flake
webServerwaited on the TCP port, butvue-cli-serviceaccepts connections before webpack''s first compile finishes. Tests started against a still-building server, and the first navigation absorbed the ~29s compile inside its own 30s timeout - soHome Page > renders home page with instructionsfailed on cold starts.It now waits on a URL, keeping that wait inside the
webServertimeout. The URL has to be the publicPath (/scrobblify/):/only resolves via the dev server''s history fallback for browser requests and 404s otherwise, which I confirmed by probing both. That test now takes 5.4s.Testing
npm run lint:check- 0 errors, exit 0npm run build- cleannpx playwright test- 28/28 pass, twice, both from a cold startThe credential-redaction test passes, confirming the
makeRequestparams change didn''t alter what gets redacted in error messages.