Skip to content

Conversation

@Pixel998
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

What changes did you make? (Give an overview)

Related Issues

Is there anything you'd like reviewers to focus on?

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for new-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/new-eslint/deploys/692cac5843f6f900085cab5d
😎 Deploy Preview https://deploy-preview-853--new-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/ja-eslint/deploys/692cac586e466f00094a42dc
😎 Deploy Preview https://deploy-preview-853--ja-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/hi-eslint/deploys/692cac58636878000808894b
😎 Deploy Preview https://deploy-preview-853--hi-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/zh-hans-eslint/deploys/692cac58e80ead00085ce770
😎 Deploy Preview https://deploy-preview-853--zh-hans-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/pt-br-eslint/deploys/692cac585edc3600088513bb
😎 Deploy Preview https://deploy-preview-853--pt-br-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/fr-eslint/deploys/692cac582898dc0008b255b5
😎 Deploy Preview https://deploy-preview-853--fr-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/de-eslint/deploys/692cac58e80ead00085ce775
😎 Deploy Preview https://deploy-preview-853--de-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 2e01022
🔍 Latest deploy log https://app.netlify.com/projects/es-eslint/deploys/692cac5a5a1cfe00081bcc6b
😎 Deploy Preview https://deploy-preview-853--es-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mdjermanovic mdjermanovic moved this from Needs Triage to Implementing in Triage Dec 1, 2025
'/* eslint quotes: ["error", "double"] */\nconst a = \'b\';';

const linter = new Linter({ configType: "flat" });
const legacyLinter = new Linter({ configType: "eslintrc" });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this wouldn't work with ESLint v10 so we have to figure out another way to get rules.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem was discussed in eslint/eslint#18103, and a proposed solution that could do the work is to fetch rules_meta.json from the eslint/eslint repo's latest branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify: does the proposed solution involve fetching rules_meta.json from the eslint repo at runtime, or is the idea to fetch it ahead of time (e.g., during build)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at runtime (i.e., not from browser) but ahead of time (e.g., during the build). Here's an example of how we are fetching versions data while building docs sites:

https://github.com/eslint/eslint/blob/main/docs/src/_data/eslintVersions.js

though I'm not sure if this example is applicable for web-packing the playground.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative to fetching is to copy this file during the eslint release process (it already creates and commits the blog post to this repo). @fasttime what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fetching rules metadata during docs build or at eslint release time are both viable solutions. Another option is using a postinstall script in src/playground/package.json (or similar) to fetch rules metadata from the installed eslint dependency, either from builtinRules or directly from the resolved lib/rules directory location in node_modules, for example:

// postinstall.js
const { writeFileSync } = require("node:fs");
const { builtinRules } = require("eslint/use-at-your-own-risk");

const rulesMeta = Object.fromEntries(builtinRules.entries().map(([key, { meta }]) => [key, meta]));

writeFileSync("rules_meta.json", JSON.stringify(rulesMeta));

This would also ensure that the rules metadata are set correctly when the Playground is built locally with an unpublished eslint version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is using a postinstall script in src/playground/package.json (or similar) to fetch rules metadata from the installed eslint dependency, either from builtinRules or directly from the resolved lib/rules directory location in node_modules, for example:

// postinstall.js
const { writeFileSync } = require("node:fs");
const { builtinRules } = require("eslint/use-at-your-own-risk");

const rulesMeta = Object.fromEntries(builtinRules.entries().map(([key, { meta }]) => [key, meta]));

writeFileSync("rules_meta.json", JSON.stringify(rulesMeta));

This look like the simplest solution at the moment so let's go with it 👍

If and when we remove the builtinRules export in the future, we can then figure out a different way to get rules_meta.json in this repo.

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

Projects

Status: Implementing

Development

Successfully merging this pull request may close these issues.

4 participants