Registry / testing / eslint-plugin-ui5

eslint-plugin-ui5

JSON →
library0.1.0jsnpmunverified

An ESLint plugin providing custom lint rules for UI5 development (OpenUI5/SAPUI5). Version 0.1.0 is the initial release, maintained as needed for UI5 projects. It includes rules to prevent common pitfalls like using global IDs, synchronous module access via global names, for...in loops, and boolean literal comparisons. Differentiates from generic ESLint by specifically targeting UI5 conventions and best practices.

npm install eslint-plugin-ui5
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-UI5
E
eslint-plugin-ui5
testingjavascriptv0.1.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rules
✓ import { rules } from 'eslint-plugin-ui5'
✗ const rules = require('eslint-plugin-ui5').rules
ESM import supported; CommonJS require also works
configs
✓ import { configs } from 'eslint-plugin-ui5'
Exports shared configs (e.g., recommended)
Plugin usage in .eslintrc
✓ plugins: ['ui5']
✗ plugins: ['eslint-plugin-ui5']
The eslint-plugin- prefix can be omitted

Installs the plugin, configures ESLint with UI5 rules, and shows a rule violation example.

// Install dependencies // npm install eslint eslint-plugin-ui5 --save-dev // .eslintrc.json { "plugins": ["ui5"], "rules": { "ui5/no-global-id": "error", "ui5/no-global-name": "error", "ui5/no-for-in": "warn", "ui5/no-boolean-literal-compare": "error", "ui5/hungarian-notation": "warn" } } // Example file: MyControl.js sap.ui.define([ "sap/ui/core/Control" ], function (Control) { return Control.extend("my.Control", { renderer: { render: function (oRM, oControl) { // This will trigger no-global-id var oCore = sap.ui.getCore(); var oById = oCore.byId("myId"); // Error if rule enabled } } }); });
Debug
Known issues
gotchaMust have ESLint installed as a peer dependency; plugin will not work without it.
fix
Run 'npm install eslint --save-dev' in your project.
affects: *
gotchaGlobal install of ESLint requires global install of this plugin as well.
fix
Install both globally: npm install -g eslint eslint-plugin-ui5
affects: *
deprecatedRule 'hungarian-notation' is stylistic and may be removed in future versions.
fix
Consider using alternative naming conventions or disabling the rule.
affects: 0.1.0
Errors
Common errors & fixes
Error: Failed to load plugin 'ui5' declared in '.eslintrc': Cannot find module 'eslint-plugin-ui5'
Plugin not installed in the project.
fix
Run 'npm install eslint-plugin-ui5 --save-dev'.
ESLint: TypeError: Cannot read property 'no-global-id' of undefined
Rule name misspelled or plugin not loaded correctly.
fix
Ensure plugin is listed in 'plugins' array and rule name is correct (e.g., 'ui5/no-global-id').
ReferenceError: sap is not defined
Code expects SAP UI5 globals without declaring them.
fix
Add 'globals' in .eslintrc: { "globals": { "sap": "readonly" } }.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required to load the plugin
Agent activity
10 hits · last 30 days
node
10
Resources
eslint-plugin-ui5 — npm install eslint-plugin-ui5 · libregistry