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

Docs: Document website-eslint #6799

Open
2 tasks done
JoshuaKGoldberg opened this issue Mar 30, 2023 · 2 comments
Open
2 tasks done

Docs: Document website-eslint #6799

JoshuaKGoldberg opened this issue Mar 30, 2023 · 2 comments
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating

Comments

@JoshuaKGoldberg
Copy link
Member

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

Suggested Changes

I'm on @Jutanium's Twitch stream. Dan is working on a browser app that includes a CodeMirror editor that we'd sure love to have ESLint run on... except, getting ESLint to run in the browser is a nontrivial task (eslint/eslint#8348). We've managed to do it though!

It'd be good to document how the website-eslint package works architecturally, similar to how we document typescript-estree on https://typescript-eslint.io/architecture/typescript-estree.

At the very least, adding a README.md to the package would be nice.

Affected URL(s)

https://typescript-eslint.io/architecture/website-eslint, maybe?

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for maintainers to take a look documentation Documentation ("docs") that needs adding/updating labels Mar 30, 2023
@bradzacher
Copy link
Member

bradzacher commented Mar 31, 2023

@armano2 knows the most - but the TLDR is that you only need/want the Linterclass - which is designed to solely operate on strings and takes object definitions for rules and parsers.

You can tree shake everything else from the package after that.

The harder part is making TS web safe and integrating that into our tooling - which required some fiddling iirc

@armano2 armano2 self-assigned this Mar 31, 2023
@armano2
Copy link
Member

armano2 commented Mar 31, 2023

making eslint work in browser is actually not that hard, as making ts-eslint work, this package is intentionally private as this is a "hack" build to work with monaco,

I will try to prepare some documentation for it after I finish "splitting" #6656, but this is low prio for me (at least for now)

this package on main is kinda a mess and i simplified it in v6
https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/website-eslint/build.ts


if you want to just load eslint for web without typescript you can look at what @mysticatea and @ota-meshi did in


Our initial versions of playground where inspired by great job done by mysticatea for vue playground


sorry for pinging

@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 Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating
Projects
None yet
Development

No branches or pull requests

3 participants