Skip to content

Repository files navigation

abap2UI5 linter

Validate abap2UI5 app classes without an SAP system — a CLI, library and GitHub Action extracted from the CI gates of samples-controls, where they guard 416 generated ports of the official UI5 demo kit samples.

It checks a whole app class, not just the XML it emits: the ABAP source and the view it builds are validated together. The defects that matter most are the ones living between the two — a bound attribute whose ABAP field does not exist, an event argument the control never delivers — and no UI5 tooling can see them, because the view only exists at runtime.

npx @abap2ui5/linter src

That is the whole of it: no install, no SAP system, no configuration. ~240 kB and no dependencies, so the line above is a fast one.

src/zcl_my_app.clas.abap
  36:14  error  sap.m.Page has no aggregation contentt - typo?                       unknown-aggregation
  40:22  error  sap.m.Button type="Emphasised" is not a valid value (allowed: ...)   invalid-property-value

Then, when you want it to stay green:

npm install -D @abap2ui5/linter          # pin it for CI and for your machine
npx abap2ui5lint --init                  # write a commented abap2ui5lint.jsonc

Documentation

The linter, in full — the two gates and what each one catches, --screenshot, --fix, waivers, the baseline for adopting it on a codebase that already exists, the config file, the GitHub Action, the badges and the library API.

Rule reference — every rule id with the paragraph explaining what it means and why it exists. The id printed at the end of a finding is the anchor.

Two more entry points, for the two other ways in:

Adding the render gate npm i -D @abap2ui5/render-runtime + npx playwright install chromium — the headless XMLView.create that catches a view which fails to load
Starting a project app-template ships the CLI, the config and the workflow already wired up

Where it runs

The CLI, a GitHub Action (abap2UI5/linter@v0), and a library — plus two consumers of that library: mcp-server exposes these gates as MCP tools for AI coding agents, and the VS Code extension surfaces the findings as editor diagnostics while you type. All of them read the same abap2ui5lint.jsonc, so the editor, the agent and CI agree.

Working on this repository

npm ci
npx playwright install chromium   # the render runtime is an npm workspace here
node cli.mjs src                  # the CLI, from the checkout
npm test

AGENTS.md carries the conventions and what every gate checks; CONTRIBUTING.md and RELEASING.md the rest of the workflow.

Three artefacts are generated and gated by npm test, so a stale one fails the build:

npm run generate-metadata    # data/properties.json, from the @openui5 sources
npm run generate-schema      # data/abap2ui5lint.schema.json — editor completion
npm run generate-rules-page  # site/index.html — the published rule reference

site/ holds that generated rule reference (published to https://abap2ui5.github.io/linter/), not documentation about this repository.

experimental/github-app/ is a spike — a working prototype of the linter as a hosted GitHub App, kept as documentation that happens to execute. It is not deployed, not registered, not shipped on npm and not supported. The delivered channels are the CLI, the library and the Action.

Credits

The reconstruction, mock-model derivation, render harness and property gate were built and battle-tested in samples-controls (scripts/render-smoke.mjs, scripts/property-check.mjs, scripts/generate-properties.mjs) against the official UI5 demo kit corpus. This package is the corpus-independent extraction.

About

A static code analysis tool for abap2UI5

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages