Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: :has() not flagged with Baseline Widely available config #60

Open
1 task done
rviscomi opened this issue Feb 21, 2025 · 1 comment · May be fixed by #61
Open
1 task done

Bug: :has() not flagged with Baseline Widely available config #60

rviscomi opened this issue Feb 21, 2025 · 1 comment · May be fixed by #61
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion enhancement New feature or request

Comments

@rviscomi
Copy link

Environment

ESLint version: 9.20.1
@eslint/css version: 0.4.0
Node version: 20.0.0
npm version: 9.6.4
Operating System: MacOS 14.7.3

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"
      }],
    },
  },
];
/* baseline/has (low) */
p:has(i) {
  color: sandybrown;
}

What did you expect to happen?

The :has() pseudo-class is not yet Baseline Widely available, according to MDN:

Image

I would have expected npx eslint src/has.css to emit a warning that it "is not a widely available baseline feature"

What actually happened?

No warnings were emitted

Link to Minimal Reproducible Example

https://github.com/rviscomi/baseline-demos/tree/main/eslint

Participation

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

Additional comments

No response

@rviscomi rviscomi added the bug Something isn't working label Feb 21, 2025
@nzakas nzakas added enhancement New feature or request and removed bug Something isn't working labels Feb 21, 2025
@nzakas
Copy link
Member

nzakas commented Feb 21, 2025

Thanks for the report. This isn't a bug because the rule doesn't yet check selectors (this is noted in the docs. I couldn't quite figure out the best way to do that and didn't want to delay the release of the plugin. If you have some time to dig in and give it a shot, I'd appreciate it.

@nzakas nzakas added the accepted There is consensus among the team that this change meets the criteria for inclusion label Feb 21, 2025
@nzakas nzakas added this to Triage Feb 21, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Feb 21, 2025
@nzakas nzakas moved this from Needs Triage to Evaluating in Triage Feb 21, 2025
rviscomi added a commit to rviscomi/eslint-css that referenced this issue Feb 22, 2025
rviscomi added a commit to rviscomi/eslint-css that referenced this issue Feb 22, 2025
@rviscomi rviscomi linked a pull request Feb 22, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion enhancement New feature or request
Projects
Status: Evaluating
Development

Successfully merging a pull request may close this issue.

2 participants