UNPKG

@sap/cds-dk

Version:

Command line client and development toolkit for the SAP Cloud Application Programming Model

14 lines (10 loc) 589 B
const Linter = require('../lib/lint/Linter'); const linter = new Linter(); // cds cli exec expects an executable object with various additional properties. // As most of the linting functionality is bound to a class instance, we need to wrap the instance // to not lose the this-context and attach the additional properties to the function. const lint = (...args) => linter.lint(...args) const additionalProperties = Object.entries(linter.init()) .map(([key, value]) => [key, { value }]) Object.defineProperties(lint, Object.fromEntries(additionalProperties)) module.exports = lint