R005: 组件尺寸使用固定值
OfficialFind fixed width/height UI usages early
Authoropenharmonyinsight
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It detects UI components that use fixed width/height values, which makes pages hard to adapt across different devices and often causes downstream XTS adaptation issues.
Core Features & Use Cases
- Covers all source code files: scans
.ets,.ts, and.jsfiles and explicitly avoids limiting analysis to test files. - Flags fixed numeric and pixel-like dimensions: detects
.width(...)/.height(...)patterns with numeric literals and string literals such as100px,100vp,200fp,50lpx. - Avoids false positives: excludes percentage-based values like
50%and variable-based usages like.width(this.someVar). - Produces actionable findings: outputs rule id, severity, file/line, testcase association (or
-for non-test files), and a targeted remediation suggestion.
Quick Start
Use the R005 rule to scan an OpenHarmony UI codebase and list every fixed width/height usage with file and line number so you can convert them to percentage-based or adaptive layouts.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: R005: 组件尺寸使用固定值 Download link: https://github.com/openharmonyinsight/openharmony-skills/archive/main.zip#r005 Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.