chore(lint): gate lint on errors, unblocked by an upstream parser bug (TKT-374) - #61
Open
sepo-eng wants to merge 1 commit into
Open
chore(lint): gate lint on errors, unblocked by an upstream parser bug (TKT-374)#61sepo-eng wants to merge 1 commit into
sepo-eng wants to merge 1 commit into
Conversation
…KT-374) `bun run lint` was red on dev and outside the CI baseline (feedback 137), so nothing stopped it drifting further. It was red on exactly one diagnostic, and that diagnostic is an oxc parser bug rather than a defect in this tree. packages/session-ui's prompt-input carries the CSS escape for U+200B inside a JSX class attribute. JSX does not process backslash escapes, so the transpiler emits the backslash verbatim, which is what the CSS needs. oxlint parses that attribute as a JS string literal and reports a deprecated octal escape at error severity. It cannot be silenced by configuration -- the diagnostic carries a null ruleId, so it is not a rule -- and the source cannot be respelled, because Tailwind v4 scans raw source text: `\\200B` compiles to `--tw-content: '\\200B'`, a literal backslash, where `\200B` compiles to the zero-width space. Both spellings were compiled with tailwindcss 4.1.11 to confirm that before touching anything. So the file is excluded, with the reasoning recorded next to the entry and the condition for removing it. It loses lint coverage until oxc is fixed. The new job gates errors, which is what oxlint exits non-zero on. dev also carries ~4980 warnings; they are not gated and the comment says so, so a green check is not misread as a warning-clean tree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbNYZHcnxRCknFmhhPHe7L
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
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.
Feedback 137:
bun run lintis red on dev and not covered by CI, so nothing stops it drifting further.dev was red on exactly one diagnostic, and it is not ours
Found 4994 warnings and 1 error— oxlint exits non-zero on the error alone. That error:The class is
empty:before:content-['\200B']— the CSS escape for U+200B, inside a JSX attribute. JSX does not process backslash escapes, so the backslash reaches the CSS verbatim, which is exactly what is wanted. oxlint parses the attribute as a JS string literal and applies string-escape rules to it. Transpiling confirms the JSX semantics:(By contrast a real JS string
"\200B"isU+0080+"B"— genuinely broken. That is the case the rule exists for, and it is not this one.)Why it could not simply be fixed or suppressed
Not suppressible.
--format=jsonreturns"ruleId": null, "code": null— it is a parser diagnostic, not a rule, so neither.oxlintrc.jsonnor anoxlint-disablecomment can reach it. Still reported by oxlint 1.60.0 and by@latest.Not respellable. Tailwind v4 scans raw source text, so changing the source changes the emitted CSS. Compiled both spellings with tailwindcss 4.1.11:
content-['\200B']--tw-content: '\200B'✅ zero-width spacecontent-['\\200B']--tw-content: '\\200B'❌ literal backslashSo "fix the violation" would have shipped a rendering regression to satisfy a false positive.
The file is therefore excluded, with that reasoning recorded next to the entry and an explicit condition for deleting it. It loses lint coverage until oxc is fixed — stated plainly rather than left for someone to discover.
The gate
New
lint.yml, mirroringtypecheck.yml(same self-hosted runner, same mandatory fork-PR guard, same setup-bun). Its own job so a lint failure reports aslintrather than under a check named for something else. ~25s.What it gates is errors — what oxlint exits non-zero on. dev also carries ~4980 warnings, which this does not gate; the workflow comment says so, so a green check is not misread as a warning-clean tree. Promoting rules or moving to
--deny-warningsis a separate decision from having a gate at all, and is not made here.After the change:
bun run lint→Found 4981 warnings and 0 errors, exit 0.Noticed, not fixed
.oxlintrc.jsondeclares"options": { "typeAware": true }three times (once near the top, twice at the end). JSON takes the last, so behaviour is unaffected, but a reader cannot tell which is authoritative. Left alone as unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01KbNYZHcnxRCknFmhhPHe7L