A static code analysis tool for UI5
UI5 linter is a static code analysis tool for UI5 projects. It checks JavaScript, XML, JSON, and other files in your project and reports findings.
Currently, it identifies deprecated API usage, global variables, and more to prepare your project for UI5 2.x.
Note
This project is still in development. While the current version already provides good value, it is not yet covering all aspects and not all best practices for UI5 2.x. Stay tuned for updates!
Install the CLI using the npm package manager:
# Global
npm install --global @ui5/linter
# In your project
npm install --save-dev @ui5/linter
Run the ui5lint
command in your project root folder
ui5lint
## UI5Lint Report ##
/application/webapp/controller/App.controller.js
10:4 error Call to deprecated function 'attachTap' of class 'Button'
/application/webapp/manifest.json
81:17 error Use of deprecated model type 'sap.ui5/models/odata/type="sap.ui.model.odata.ODataModel"'
/application/webapp/test/unit/unitTests.qunit.js
6:1 error Call to deprecated function 'attachInit' of class 'Core'
6:1 error Call to deprecated function 'getCore' (sap.ui.getCore)
6:1 error Access of global variable 'sap' (sap.ui.getCore)
/application/webapp/view/Main.view.xml
16:39 error Import of deprecated module 'sap/m/MessagePage'
22:5 error Use of deprecated property 'blocked' of class 'Button'
7 problems (7 errors, 0 warnings)
Note: Use "ui5lint --details" to show more information about the findings
Show more information about the findings and how to fix them.
Example:
ui5lint --details
Choose the output format. Currently, stylish
(default) and json
are supported.
Example:
ui5lint --format json
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
You can also chat with us in the #tooling
channel of the OpenUI5 Community Slack. For public Q&A, use the ui5-tooling
tag on Stack Overflow.
If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Copyright 2024 SAP SE or an SAP affiliate company and contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.