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

Website: Consider aligning to eslint.org 'Open in Website' #7315

Closed
2 tasks done
JoshuaKGoldberg opened this issue Jul 25, 2023 · 3 comments · Fixed by #7482
Closed
2 tasks done

Website: Consider aligning to eslint.org 'Open in Website' #7315

JoshuaKGoldberg opened this issue Jul 25, 2023 · 3 comments · Fixed by #7482
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: website Issues related to the @typescript-eslint website

Comments

@JoshuaKGoldberg
Copy link
Member

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

eslint/eslint#17018 -> eslint/eslint#17306 added playground links to correct and incorrect code blocks in the ESLint playground. The design the ESLint team asked for is different from ours:

  • We (typescript-eslint.io) have a single Try this rule in the playground ↗ link on a rules page, floating underneath the config example
  • eslint.org instead has an Open in Playground link in the bottom-right of each rule (in)correct code snippet

I very much like how the eslint.org approach lets users directly try out code snippets (thanks @nzakas! ref: eslint/eslint#17018 (comment)). How about we add the same type to our website?

I'm actually leaning towards keeping the existing Try this rule in the playground ↗ link -perhaps de-emphasizing it visually- so that folks still get the link above the fold & in a consistent location.

Affected URL(s)

https://typescript-eslint.io/rules/*

@JoshuaKGoldberg JoshuaKGoldberg added enhancement New feature or request triage Waiting for maintainers to take a look package: website Issues related to the @typescript-eslint website labels Jul 25, 2023
@bradzacher
Copy link
Member

I very much like how the eslint.org approach lets users directly try out code snippets

That was actually my original thought with the feature - but as a v0 opening the playground with the rule configured was "good enough".

@bradzacher
Copy link
Member

Slightly off-topic but one other feature I'd love: interactive examples.

For example the Vue plugin embeds Monaco for each example!
https://eslint.vuejs.org/rules/multi-word-component-names.html

A lighter thought was maybe we do something like twoslash and pre-calculate the errors to render statically for each example.

@nzakas
Copy link
Contributor

nzakas commented Jul 26, 2023

Slightly off-topic but one other feature I'd love: interactive examples.

This was actually how we envisioned the rules documentation working but we ran out of time so designed a fallback with "Open in Playground".

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Jul 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: website Issues related to the @typescript-eslint website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants