eslint-plugin-better-cap-config
A set of ESLint rules that read CAP configuration and flag the cds settings that have since been deprecated, putting that check in the linter a project already runs, with no dependencies of its own.
Deprecated cds configuration keeps working until it does not, and the compiler is not where you find out. This puts the check in the linter you already run, with zero dependencies of its own.
Facts
Where it sits
Who is behind it
In the atlas: maintains 16, contributes to 41, wrote 4@mauriciolauffermaintainer
What it declares
Every artifact
- Type
- Build tool
- Origin
- Independently maintained
- Runtime
- build time
As a build tool
- Distributed through
- npm
Connections
Catching problems in code, models and configuration by rules
Download
Install
npm add eslint-plugin-better-cap-configDerived from the package name. No recipe recorded; the README has the configuration.
Learn more
- Introducing eslint-plugin-better-cap-config an ESLint plugin to improve CAP configurationIntroducing eslint-plugin-better-cap-config an ESLint plugin to improve CAP configurationThe author's own announcement, and precise about scope: today it catches deprecated key/value entries in CAP's JSON configuration, and the ambition is that it grows into best practices, suggestions and autofixes the way any ESLint plugin does. The implementation detail worth knowing is that it uses modern ESLint's JSON language support rather than a generic parser, which is what makes linting a configuration file rather than source code work at all.published 2025-09-08Mauricio Lauffer, SAP Community
README
quoted from mauriciolauffer/eslint-plugin-better-cap-config under MIT, readESLint Plugin Better CAP Config
An ESLint plugin for improving SAP CAP (Cloud Application Programming Model) configuration patterns in JSON files.
Features
- Detects deprecated SAP CAP configuration patterns
- Works with
package.json,.cdsrc.json, and other CDS configuration files - Modern ESLint v9+ support with flat config
Installation
npm install --save-dev eslint @eslint/json eslint-plugin-better-cap-config
Rules
| Rule | Description |
|---|---|
cds-cdsc-newparser | Disallow deprecated cds.cdsc.newparser: false configuration |
cds-drafts-cancellation-timeout | Disallow deprecated cds.drafts.cancellationTimeout configuration |
cds-features-async-handler-compat | Disallow deprecated cds.features.async_handler_compat configuration |
cds-features-base64-binaries | Disallow deprecated cds.features.base64_binaries configuration |
cds-features-bulk-inserts-via-rest | Disallow deprecated cds.features.bulk_inserts_via_rest: false configuration |
cds-features-cds-validate | Disallow deprecated cds.features.cds_validate configuration |
cds-features-compat-assert-not-null | Disallow deprecated cds.features.compat_assert_not_null configuration |
cds-features-compat-clone-appends | Disallow deprecated cds.features.compat_clone_appends configuration |
cds-features-compat-restrict-bound | Disallow deprecated cds.features.compat_restrict_bound configuration |
cds-features-compat-restrict-where | Disallow deprecated cds.features.compat_restrict_where configuration |
cds-features-compat-save-drafts | Disallow deprecated cds.features.compat_save_drafts configuration |
cds-features-compat-srv-getters | Disallow deprecated cds.features.compat_srv_getters configuration |
cds-features-compat-static-auth | Disallow deprecated cds.features.compat_static_auth configuration |
cds-features-compat-texts-entities | Disallow deprecated cds.features.compat_texts_entities configuration |
cds-features-compile-for-flows | Disallow deprecated cds.features.compile_for_flows configuration |
cds-features-consistent-params | Disallow deprecated cds.features.consistent_params: false configuration |
cds-features-keys-in-data-compat | Disallow deprecated cds.features.keys_in_data_compat configuration |
cds-features-kibana-formatter | Disallow deprecated cds.features.kibana_formatter configuration |
cds-features-legacy-srv-results | Disallow deprecated cds.features.legacy_srv_results: true configuration |
cds-features-new-draft-via-action | Disallow deprecated cds.features.new_draft_via_action configuration |
cds-features-odata-metadata-compat | Disallow deprecated cds.features.odata_metadata_compat configuration |
cds-features-odata-new-adapter | Disallow deprecated cds.features.odata_new_adapter configuration |
cds-features-serve-on-root | Disallow deprecated cds.features.serve_on_root: true configuration |
cds-features-service-level-restrictions | Disallow deprecated cds.features.service_level_restrictions: false configuration |
cds-features-stream-compat | Disallow deprecated cds.features.stream_compat configuration |
cds-features-xssec-compat | Disallow deprecated cds.features.xssec_compat configuration |
cds-fiori-calc-elements | Disallow deprecated cds.fiori.calc_elements configuration |
cds-fiori-draft-compat | Disallow deprecated cds.fiori.draft_compat configuration |
cds-fiori-direct-crud | Disallow deprecated cds.fiori.direct_crud configuration |
cds-fiori-lean-draft | Disallow deprecated cds.fiori.lean_draft: false configuration |
cds-i18n-fatjson | Disallow deprecated cds.i18n.fatjson configuration |
cds-log-kibana-custom-fields | Disallow deprecated cds.log.kibana_custom_fields configuration |
cds-mcp-auto-config | Disallow deprecated cds.mcp.autoConfig configuration (renamed to autoWired) |
cds-multitenant-client-cert-header | Disallow deprecated cds.multiTenancy.subscriptionManager.clientCertificateHeader configuration |
cds-remote-native-fetch | Disallow deprecated cds.remote.native_fetch configuration |
cds-requires-db-database | Disallow deprecated cds.requires.db.database configuration |
cds-requires-middlewares | Disallow deprecated cds.requires.middlewares: false configuration |
cds-sql-collate | Disallow deprecated cds.sql.collate configuration |
cds-sql-native-hana-associations | Disallow deprecated cds.sql.native_hana_associations: true configuration |
cds-sql-runtime-view-mode | Disallow deprecated cds.sql.runtimeView.mode: "resolve" configuration |
cds-sql-transitive-localized-views | Disallow deprecated cds.sql.transitive_localized_views: true configuration |
Configuration
Add the plugin to your ESLint configuration:
ESLint v9+ (Flat Config)
import json from "@eslint/json";
import capConfig from "eslint-plugin-better-cap-config";
export default [
{
files: ["**/*.json"],
plugins: {
json,
"cap-config": capConfig,
},
language: "json/json",
rules: {
"cap-config/cds-fiori-draft-compat": "error",
"cap-config/cds-features-odata-new-adapter": "error",
"cap-config/cds-features-cds-validate": "error",
},
},
];
Using the Recommended Configuration
import { defineConfig } from "eslint/config";
import json from "@eslint/json";
import capConfig from "eslint-plugin-better-cap-config";
export default defineConfig([
{
files: ["**/*.json"],
plugins: {
json,
},
language: "json/json",
extends: [capConfig.configs.recommended],
},
]);
Prerequisites
This plugin requires:
- ESLint v9.0.0 or higher
- Node.js v18.0.0 or higher
@eslint/jsonfor JSON language support
Supported Files
The plugin works with:
package.jsonfiles.cdsrc.jsonfiles- Any JSON files containing CDS configuration
Development
Building
pnpm build
Testing
pnpm test
pnpm test:watch
pnpm test:coverage
Linting
pnpm lint
pnpm lint:fix
License
MIT License
History
Features 1
Others providing
Compare all 11 on the Linting page →- @cbs-consulting/cds-eslint@cbs-consulting/cds-eslintAn ESLint plugin for CDS files carrying one consultancy's own rules, published so that the consultancy's projects lint their CDS models the same way.independent, capESLint plugin with one consultancy's rules for CDS filesfrom CAP
- @cbs-consulting/tools@cbs-consulting/toolsShared ESLint configuration for SAPUI5 and CAP projects, the config rather than the rules, so a team adopts a house style by adding one dependency.independent, capShared ESLint configuration for SAPUI5 and CAP projectsfrom CAP
- ui5plugin-linterui5plugin-linterA command-line linter for UI5 projects, run as ui5linter, that checks JavaScript and TypeScript classes, XML views and fragments, and i18n properties files.independent, ui5Command-line linter for UI5 classes, XML views and i18n filesfrom UI5
- ui5pluginui5pluginThe SAPUI5 Extension for Visual Studio Code: completion, definitions, CodeLens, diagnostics, code actions, hover and an XML formatter for UI5 views, controllers and manifest.json.independent, ui5SAPUI5 extension for Visual Studio Codefrom UI5
- hana-linterhana-linterA command line that checks the names of the native SAP HANA artifact files in a CAP project, and the identifiers inside them, against regex rules the project keeps in a config file.independent, capRegex naming rules for SAP HANA artifacts in a CAP projectfrom CAP
- @sap/eslint-plugin-cds@sap/eslint-plugin-cdsSAP's ESLint plugin for CDS, carrying the model and environment rules capire calls best practice and universal for every CAP project.sap official, capSAP's ESLint plugin for CDSfrom CAP
- @sap-ux/eslint-plugin-fiori-tools@sap-ux/eslint-plugin-fiori-toolsESLint rules from the Fiori tools team, aimed at the parts of a project their generators produce.sap official, capESLint rules for projects the Fiori tools generators producefrom CAP
- vscode-ui5-language-assistantvscode-ui5-language-assistantSAP's VS Code extension for SAPUI5 and OpenUI5: completion, validation, hover tooltips, go to definition, quick fix and formatting for XML views, and completion and validation for manifest.json.sap official, ui5VS Code extension for SAPUI5 and OpenUI5 XML views and manifestfrom UI5
- @satiroglu/kaev@satiroglu/kaevA command line that runs rule-based checks over a SAPUI5 or OpenUI5 project, reporting each finding with a rule id, a category, a severity, a confidence and the file it sits in.independent, ui5Rule-based checker for SAPUI5 and OpenUI5 projectsfrom UI5
- @ui5/linter@ui5/linterSAP's static analysis tool for UI5 projects: it scans JavaScript, TypeScript, XML, JSON and other files for deprecated APIs, global variables and possible CSP violations, and fixes part of them with --fix.sap official, ui5Static analysis tool for UI5 projectsfrom UI5
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:mauriciolauffer-eslint-plugin-better-cap-config- JSON
- /artifacts/mauriciolauffer-eslint-plugin-better-cap-config.json
- MCP
- Connecting an agent