{"id":19964,"library":"eslint-plugin-ui5","title":"eslint-plugin-ui5","description":"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.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","eslint","eslintplugin","eslint-plugin","ui5","openui5","sapui5"],"install":[{"cmd":"npm install eslint-plugin-ui5","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-ui5","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-ui5","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to load the plugin","package":"eslint","optional":false}],"imports":[{"note":"ESM import supported; CommonJS require also works","wrong":"const rules = require('eslint-plugin-ui5').rules","symbol":"rules","correct":"import { rules } from 'eslint-plugin-ui5'"},{"note":"Exports shared configs (e.g., recommended)","symbol":"configs","correct":"import { configs } from 'eslint-plugin-ui5'"},{"note":"The eslint-plugin- prefix can be omitted","wrong":"plugins: ['eslint-plugin-ui5']","symbol":"Plugin usage in .eslintrc","correct":"plugins: ['ui5']"}],"quickstart":{"code":"// Install dependencies\n// npm install eslint eslint-plugin-ui5 --save-dev\n\n// .eslintrc.json\n{\n  \"plugins\": [\"ui5\"],\n  \"rules\": {\n    \"ui5/no-global-id\": \"error\",\n    \"ui5/no-global-name\": \"error\",\n    \"ui5/no-for-in\": \"warn\",\n    \"ui5/no-boolean-literal-compare\": \"error\",\n    \"ui5/hungarian-notation\": \"warn\"\n  }\n}\n\n// Example file: MyControl.js\nsap.ui.define([\n  \"sap/ui/core/Control\"\n], function (Control) {\n  return Control.extend(\"my.Control\", {\n    renderer: {\n      render: function (oRM, oControl) {\n        // This will trigger no-global-id\n        var oCore = sap.ui.getCore();\n        var oById = oCore.byId(\"myId\"); // Error if rule enabled\n      }\n    }\n  });\n});","lang":"javascript","description":"Installs the plugin, configures ESLint with UI5 rules, and shows a rule violation example."},"warnings":[{"fix":"Run 'npm install eslint --save-dev' in your project.","message":"Must have ESLint installed as a peer dependency; plugin will not work without it.","severity":"gotcha","affected_versions":"*"},{"fix":"Install both globally: npm install -g eslint eslint-plugin-ui5","message":"Global install of ESLint requires global install of this plugin as well.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using alternative naming conventions or disabling the rule.","message":"Rule 'hungarian-notation' is stylistic and may be removed in future versions.","severity":"deprecated","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-ui5 --save-dev'.","cause":"Plugin not installed in the project.","error":"Error: Failed to load plugin 'ui5' declared in '.eslintrc': Cannot find module 'eslint-plugin-ui5'"},{"fix":"Ensure plugin is listed in 'plugins' array and rule name is correct (e.g., 'ui5/no-global-id').","cause":"Rule name misspelled or plugin not loaded correctly.","error":"ESLint: TypeError: Cannot read property 'no-global-id' of undefined"},{"fix":"Add 'globals' in .eslintrc: { \"globals\": { \"sap\": \"readonly\" } }.","cause":"Code expects SAP UI5 globals without declaring them.","error":"ReferenceError: sap is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}