npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cbs-consulting/cds-eslint

v1.0.0

Published

ESLint plugin for CDS (Core Data Services) files with custom linting rules

Readme

@cbs-consulting/cds-eslint

ESLint plugin for CDS (Core Data Services) files with custom linting rules for better code quality and consistency.

Installation

npm install --save-dev @cbs-consulting/cds-eslint eslint

Usage

Configuration (ESLint 9+ Flat Config)

Create an eslint.config.js in your project root:

const cdsLint = require("@cbs-consulting/cds-eslint");

module.exports = [
  // Simply use the recommended config - it includes parser and all settings
  cdsLint.configs.recommended,
  
  // ...your other configs
];

That's it! The plugin handles the CDS parser internally.

Custom Configuration

If you want to customize the rules:

const cdsLint = require("@cbs-consulting/cds-eslint");

module.exports = [
  {
    files: ["**/*.cds"],
    languageOptions: {
      parser: cdsLint.parsers.cds,
    },
    plugins: {
      "@cbs-consulting/cds-eslint": cdsLint,
    },
    rules: {
      "@cbs-consulting/cds-eslint/group-by-matches-keys": "warn", // or "error"
    },
  },
];

VS Code Integration

For the best development experience with inline error highlighting in VS Code:

  1. Install the ESLint extension:

    • Open VS Code
    • Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
    • Search for "ESLint" by Microsoft
    • Click Install
  2. Configure VS Code settings:

    Add to your .vscode/settings.json:

    {
      "eslint.validate": [
        "javascript",
        "javascriptreact",
        "typescript",
        "typescriptreact",
        "cds"
      ],
      "eslint.probe": [
        "javascript",
        "javascriptreact",
        "typescript",
        "typescriptreact",
        "cds"
      ],
      "eslint.options": {
        "extensions": [".js", ".jsx", ".ts", ".tsx", ".cds"]
      }
    }
  3. Restart VS Code to ensure the settings take effect.

Now, CDS files will show inline errors and warnings directly in the editor!

Command Line Usage

You can also run the linter from the command line:

npx eslint "**/*.cds"

Or add to your package.json scripts:

{
  "scripts": {
    "lint": "eslint \"**/*.cds\"",
    "lint:fix": "eslint \"**/*.cds\" --fix"
  }
}

Rules

group-by-matches-keys

Ensures that GROUP BY clauses in CDS views match key columns exactly.

Rule Details:

This rule enforces that GROUP BY clauses properly align with the key columns defined in CDS entity projections and views.

Examples of incorrect code:

// ❌ Missing key in GROUP BY
entity BadExample1 as
  select from Orders as o {
    key o.ID,
    key o.OrderNo,  // ❌ OrderNo is a key but not in GROUP BY
        sum(o.price) as totalPrice
  }
  group by o.ID;

// ❌ Non-key column in GROUP BY
entity BadExample2 as
  select from Orders as o {
    key o.ID,
        o.quantity,  // ❌ quantity is not a key but is in GROUP BY
        sum(o.price) as totalPrice
  }
  group by
    o.ID,
    o.quantity;

// ❌ Undefined column in GROUP BY
entity BadExample3 as
  select from Orders as o {
    key o.productID,
        count(*) as orderCount
  }
  group by
    o.productID,
    o.customerID;  // ❌ customerID is not selected

Examples of correct code:

// ✅ All keys in GROUP BY, no non-keys
entity GoodExample1 as
  select from Orders as o {
    key o.ID,
    key o.OrderNo,
        sum(o.price) as totalPrice
  }
  group by
    o.ID,
    o.OrderNo;

// ✅ Single key with aggregation
entity GoodExample2 as
  select from Orders as o {
    key o.productID,
        count(*) as orderCount,
        sum(o.price) as totalRevenue
  }
  group by o.productID;