clmc2025/vignette
Overview
This skill detects and fixes ArkTS code-style and best-practice issues to keep projects aligned with official ArkTS guidelines. It runs in real time in the IDE or as a CLI step before reviews, offering clear diagnostics, severity levels, and automatic fixes. It supports configurable rules, custom checks, and safe undoable fixes for bulk operations.
How this skill works
The linter scans ArkTS source files for syntax, format, naming, decorator, and component-rule violations, then categorizes issues as errors, warnings, or tips. For each violation it provides a precise location, a human-readable explanation, and a suggested code fix. Common problems can be auto-fixed in-place or applied across directories, and users can extend or disable rules via a project configuration file.
When to use it
- During development with IDE realtime feedback
- As a pre-commit or CI check before code review
- When migrating ArkTS to new framework or version
- To enforce team style and best practices across a codebase
- When optimizing for runtime performance patterns
Best practices
- Enable realtime detection in your IDE and run batch checks before merging
- Create a project .arktslintrc.json to lock team rules and ignores
- Start with recommended severity settings, then tune per project needs
- Use one-click fix for low-risk issues and review changes for major refactors
- Add custom rules for project-specific patterns rather than ad-hoc fixes
Example use cases
- Run trae arkts-code-linter check src to find syntax and format issues before a release
- Use trae arkts-code-linter fix src to automatically apply safe fixes across the codebase
- Add a CI pipeline step to fail builds on rule errors and warn on less severe issues
- Configure custom rules to enforce internal component boundaries and naming conventions
- Temporarily ignore a line or block with // @arktslint-ignore when external constraints require it
FAQ
Add patterns to the ignore array in .arktslintrc.json, or annotate code with // @arktslint-ignore <rule> to skip specific checks.
Can I add project-specific rules?
Yes. The config supports customRules that load rule scripts which return name, severity, and a check function that can suggest fixes.