Skip to content

Bug: generate-baseline misses many functions #72

Open
@rviscomi

Description

@rviscomi

Environment

Node version: v20.0.0
npm version: v9.6.4
Local ESLint version: v9.21.0 (Currently used)
Global ESLint version: Not found
@eslint/css version: 0.4.0
Operating System: darwin 23.6.0

Which language are you using?

stylesheet

What did you do?

Configuration
import globals from "globals";
import css from "@eslint/css";


/** @type {import('eslint').Linter.Config[]} */
export default [
  {
    languageOptions: {
      globals: globals.browser
    }
  },
  {
    files: ["**/*.css"],
    plugins: {
      css,
    },
    language: "css/css",
    rules: {
      "css/require-baseline": ["warn", {
        "available": "widely"
      }],
    },
  },
];
/** src/functions.css */
a {
  background: color-mix(in srgb, lightblue, white 80%);
}

div {
  background: conic-gradient(from 0deg at 0% 25%, blue, green, yellow 180deg);
}
npx eslint src/functions.css

What did you expect to happen?

ESLint should warn when Baseline newly available features like color-mix and conic-gradient are used.

I'd also expect the types map within baseline-data.js to include entries for functions like color-mix and conic-gradient.

There is a related color entry, but its Baseline status should be Newly available (5) according to MDN.

What actually happened?

ESLint doesn't emit any warnings for these newly available features, despite the config being set to widely available.

color-mix and conic-gradient aren't listed in the types map, and color has a Baseline status of Widely available (10).

Link to Minimal Reproducible Example

https://github.com/rviscomi/baseline-demos/blob/main/eslint/src/functions.css

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

The cssTypePattern regex seems to be responsible for this:

const cssTypePattern = /^css\.types\.(?<type>[a-zA-Z$\d-]+)$/u;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionbugSomething isn't working

    Type

    Projects

    • Status

      Ready to Implement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions