-
Notifications
You must be signed in to change notification settings - Fork 8
Preview/ember-template-lint #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| inheritance: false | ||
| reviews: | ||
| profile: assertive | ||
| review_details: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "rules": { | ||
| "no-bare-strings": "error", | ||
| "require-button-type": "error", | ||
| "require-valid-alt-text": "error" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strong suggestion: add at least one Ember-specific rule + matching fixture so tool provenance is distinguishable. The three enabled rules ( To make tool provenance unambiguous, add at least one rule that an LLM is unlikely to flag from generic HTML knowledge alone, plus a matching fixture line in {
"rules": {
"no-bare-strings": "error",
"require-button-type": "error",
"require-valid-alt-text": "error",
"no-implicit-this": "error",
"deprecated-each-syntax": "error"
}
}Then add corresponding bait, e.g.:
Once one of those Ember-specific rule names appears in a CodeRabbit Severity: strong suggestion (not a blocker — this is a demo/preview branch that doesn't merge). |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,53 @@ | ||||||||||||||||||
| <article> | ||||||||||||||||||
| <img src="product.jpg"> | ||||||||||||||||||
| <h3>Premium Widget</h3> | ||||||||||||||||||
| <p>Only $29.99 — Order now and save 20%!</p> | ||||||||||||||||||
| <span>Free shipping on all orders</span> | ||||||||||||||||||
| <button>Add to Cart</button> | ||||||||||||||||||
| <button>Buy Now</button> | ||||||||||||||||||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "bad.hbs" -o -name "*.hbs" | head -20Repository: coderabbitai/coderabbit-pr-review Length of output: 87 🏁 Script executed: cat -n bad.hbsRepository: coderabbitai/coderabbit-pr-review Length of output: 1646 Buttons inside Lines 14-15 lack type attributes:
Buttons at lines 6-7, 32, 42, 48, and 51 are not inside form elements, so they don't pose a form submission risk. 🤖 Prompt for AI Agents |
||||||||||||||||||
| </article> | ||||||||||||||||||
| <form> | ||||||||||||||||||
| <label>Username</label> | ||||||||||||||||||
| <input type="text" placeholder="Enter username"> | ||||||||||||||||||
| <label>Password</label> | ||||||||||||||||||
| <input type="password"> | ||||||||||||||||||
|
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "bad.hbs" -type fRepository: coderabbitai/coderabbit-pr-review Length of output: 87 🏁 Script executed: cat -n bad.hbsRepository: coderabbitai/coderabbit-pr-review Length of output: 1646 🏁 Script executed: rg -t handlebars '{{t\s' --max-count=5Repository: coderabbitai/coderabbit-pr-review Length of output: 158 🏁 Script executed: rg -t handlebars '\{\{t ' --max-count=5Repository: coderabbitai/coderabbit-pr-review Length of output: 112 🏁 Script executed: rg '\{\{t ' -g '*.hbs' --max-count=10Repository: coderabbitai/coderabbit-pr-review Length of output: 59 🏁 Script executed: fd -e hbs -type fRepository: coderabbitai/coderabbit-pr-review Length of output: 248 🏁 Script executed: fd '\\.hbs$'Repository: coderabbitai/coderabbit-pr-review Length of output: 59 🏁 Script executed: git ls-files | head -20Repository: coderabbitai/coderabbit-pr-review Length of output: 133 🏁 Script executed: cat .template-lintrc.json && echo "---" && cat README.mdRepository: coderabbitai/coderabbit-pr-review Length of output: 229 Associate labels with inputs for accessible form navigation. Lines 10 and 12 labels are not bound to corresponding inputs. Add Suggested fix- <label>Username</label>
- <input type="text" placeholder="Enter username">
- <label>Password</label>
- <input type="password">
+ <label for="username">Username</label>
+ <input id="username" type="text" placeholder="Enter username">
+ <label for="password">Password</label>
+ <input id="password" type="password">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| <button>Log In</button> | ||||||||||||||||||
| <button>Reset</button> | ||||||||||||||||||
| <p>Forgot your password?</p> | ||||||||||||||||||
| </form> | ||||||||||||||||||
| <section> | ||||||||||||||||||
| <h2>Photo Gallery</h2> | ||||||||||||||||||
| <div> | ||||||||||||||||||
| <img src="sunset.jpg"> | ||||||||||||||||||
| <p>A beautiful sunset over the mountains</p> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div> | ||||||||||||||||||
| <img src="beach.jpg"> | ||||||||||||||||||
| <p>Sandy beach with crystal clear water</p> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div> | ||||||||||||||||||
| <img src="forest.jpg"> | ||||||||||||||||||
| <p>Dense forest trail in autumn</p> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <button>Load More Photos</button>Collapse comment | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove accidental text artifact on Line 32.
🧹 Proposed fix- <button>Load More Photos</button>Collapse comment
+ <button type="button">{{t "gallery.load_more"}}</button>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| </section> | ||||||||||||||||||
| <nav> | ||||||||||||||||||
| <h1>My Application</h1> | ||||||||||||||||||
| <ul> | ||||||||||||||||||
| <li>Home</li> | ||||||||||||||||||
| <li>About Us</li> | ||||||||||||||||||
| <li>Services</li> | ||||||||||||||||||
| <li>Contact</li> | ||||||||||||||||||
| </ul> | ||||||||||||||||||
| <button>Menu</button> | ||||||||||||||||||
| <img src="avatar.png"> | ||||||||||||||||||
| </nav> | ||||||||||||||||||
| <div> | ||||||||||||||||||
| <h1>Welcome to our site</h1> | ||||||||||||||||||
| <p>Click the button below</p> | ||||||||||||||||||
| <button>Submit</button> | ||||||||||||||||||
| <img src="hero.jpg"> | ||||||||||||||||||
| <span>Contact us</span> | ||||||||||||||||||
| <button>Cancel</button> | ||||||||||||||||||
| <img src="icon.png"> | ||||||||||||||||||
|
Comment on lines
+3
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
file="$(fd '^bad\.hbs$' | head -n1)"
echo "Inspecting: $file"
echo -e "\nButtons without explicit type:"
rg -nP '<button(?![^>]*\btype=)[^>]*>' "$file" || true
echo -e "\nImages without alt:"
rg -nP '<img(?![^>]*\balt=)[^>]*>' "$file" || true
echo -e "\nPotential bare strings between tags:"
rg -nP '>\s*[A-Za-z][^<{]*<' "$file" || true
echo -e "\nLabels without for=:"
rg -nP '<label(?![^>]*\bfor=)[^>]*>' "$file" || trueRepository: coderabbitai/coderabbit-pr-review Length of output: 1593 Localize hardcoded UI copy to comply with the configured All text content across lines 3–52 must be wrapped in a localization helper (e.g.,
Proposed localization pattern- <h3>Premium Widget</h3>
- <p>Only $29.99 — Order now and save 20%!</p>
- <button>Add to Cart</button>
+ <h3>{{t "product.premium_widget.title"}}</h3>
+ <p>{{t "product.premium_widget.promo_text"}}</p>
+ <button type="button">{{t "actions.add_to_cart"}}</button>🤖 Prompt for AI Agents |
||||||||||||||||||
| </div> | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strong suggestion: explicitly wire
emberTemplateLintso the preview actually exercises the tool path.With
inheritance: falseand noreviews.toolssection, this config never explicitly enables the ember-template-lint integration. Empirically, the 4 CodeRabbit inline comments on this PR (bad.hbs:7/:13/:32/:52) contain zero🪛 ember-template-linttool blocks and zero🧰 Toolsblocks — they read as generic HTML/accessibility observations from the LLM reviewer, not tool-backed output. By comparison, PR #97 (Preview/Stylelint) surfaces two🪛 Stylelint (17.9.0)blocks, proving tool-backed output is identifiable when it actually runs.The second commit (
1d636b6 "show tooling in review detils") addedreview_details: true, which is a sensible step but doesn't add the tool entry the preview needs. Addingreview_details: truealone does not turn on a tool that the config has not explicitly enabled.The canonical tool key is
emberTemplateLint(camelCase) per the CodeRabbitschema.v2.jsonreviews.toolsproperties —ember-template-lint(kebab-case) is not a recognized key. Note that PR #96 (Preview/EmberTemplate)'s current head ships the kebab-case form, which is also why that branch has zero🪛 ember-template-linttool blocks despite explicit wiring; PR #96 is a more explicit failed attempt, while this PR has even less wiring than that.Suggested config:
Severity: strong suggestion (not a blocker — this is a demo/preview branch that doesn't merge).