// |
| name | sapui5-linter |
| description | | |
The UI5 Linter (@ui5/linter) is a static code analysis tool designed specifically for SAPUI5 and OpenUI5 projects. It helps developers identify compatibility issues, deprecated APIs, security concerns, and best practice violations before upgrading to UI5 2.x.
Key Capabilities:
Current Version: 1.20.5 (November 2025) Official Repository: https://github.com/UI5/linter
Node.js: v20.11.x, v22.0.0, or higher npm: v8.0.0 or higher
Verify prerequisites:
node --version # Should be v20.11+ or v22+
npm --version # Should be v8+
Global Installation (recommended for CLI usage):
npm install --global @ui5/linter
Local Installation (recommended for project integration):
npm install --save-dev @ui5/linter
Verify installation:
ui5lint --version # Should output: 1.20.5 or higher
Run linter from project root:
# Lint entire project
ui5lint
# Lint specific files or directories
ui5lint "webapp/**/*.js"
ui5ling "webapp/controller/" "webapp/view/"
# Show detailed information about findings
ui5lint --details
Development Workflow:
# 1. Check for issues with details
ui5lint --details
# 2. Preview automatic fixes
UI5LINT_FIX_DRY_RUN=true ui5lint --fix
# 3. Apply fixes
ui5lint --fix
# 4. Review changes
git diff
# 5. Verify fixes worked
ui5lint --details
Create ui5lint.config.{js|mjs|cjs}:
module.exports = {
rules: {
// Recommended rules
"no-deprecated-api": "error",
"no-globals": "error",
"no-ambiguous-event-handler": "error",
"no-outdated-manifest-version": "error"
},
exclude: [
"dist/**",
"node_modules/**",
"test/**/*.{spec,js,ts}"
]
};
// Strict for production, relaxed for development
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
rules: {
"no-deprecated-api": isProduction ? "error" : "warn",
"no-globals": isProduction ? "error" : "warn"
},
exclude: [
"legacy/**/*",
"**/*.min.js"
]
};
# Basic linting
ui5lint
# With detailed output
ui5lint --details
# Fix auto-fixable issues
ui5lint --fix
# JSON output for CI/CD
ui5lint --format json
# HTML report for documentation
ui5lint --format html --details
# Performance monitoring
ui5lint --perf
references/rules-complete.md{
"scripts": {
"lint": "ui5lint",
"lint:fix": "ui5lint --fix",
"lint:details": "ui5lint --details",
"lint:ci": "ui5lint --quiet --format json > lint-results.json",
"lint:report": "ui5lint --format html --details > lint-report.html"
},
"devDependencies": {
"@ui5/linter": "^1.20.5"
}
}
Symptom: Linter reports parsing errors Solution: Check for syntax errors in config files
Symptom: Autofix doesn't work
Solution: Check autofix limitations in references/autofix-complete.md
Symptom: Performance issues on large codebase Solution: Add ignore patterns, use targeted linting
references/rules-complete.mdreferences/autofix-complete.mdreferences/performance.mdreferences/support-and-community.mdreferences/contributing.mdtemplates/ui5lint.config.mjstemplates/package.json.templatetemplates/husky-pre-commit.templateLast Updated: 2025-11-26 | Version: 1.0.1 (Restructured) Previous Version: 1.0.0 | Lines Reduced: 376 (from 827) Next Review: 2026-02-25