-
Couldn't load subscription status.
- Fork 52
feat: add valid-test-annotations rule #397
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
Conversation
…nnotation format
This rule addresses a critical production issue where incorrect annotation format
(annotation: "bug" instead of annotation: { type: "bug" }) was causing test
reports to break and not show up.
The rule validates that:
- Annotations are objects or arrays of objects (not strings)
- Each annotation has a required 'type' property
- Optional 'description' property is a string
- Only 'type' and 'description' properties are allowed
- Detects when 'tag' is incorrectly placed inside 'annotation'
This will catch these issues at lint time, preventing broken test reports
before they reach CI/CD.
Fixes the issue discovered in test @XRAY-13376 where annotation: "bug"
caused the test report to not show up.
|
A cryptic stack trace is not helpful, what code did you have that was causing breakage? |
@mskelton, the code was |
|
This should already be handled by Playwright's TypeScript types. Why do we need a linter to implement types? |
For js files. Even for ts - runtime validation does not check the structure of annotation obj and always thinks that is valid |
|
fixed here: microsoft/playwright#37761 |
Just use |
|
I'm declining this, this plugin is not for the purpose of doing what TypeScript can already do. Seriously, just use TypeScript. |
This is not something I can control at this place of work. I tried to enforce it. |



Hello @mskelton!
I've created a new rule that addresses the real production issue my team discovered where incorrect annotation format was breaking test reports.
P.S + excluded .history folder