Skip to content

docs: replace astexplorer.net links with playground #4376

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/development/architecture/ASTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ ESLint uses an AST format known as **[`estree`]**.
ESTree is more broadly used than just for ESLint -- it is the de facto community standard.
ESLint's built-in parser that outputs an `estree`-shaped AST is also a separate package, called **[`espree`]**.

## AST Playground

The [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es) contains an AST explorer that generates an interactive AST for any code entered into the playground.
You can activate it under _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_.

:::note

You can play more with various ASTs such as ESTree on [astexplorer.net] and read more details on their [Wikipedia article](https://en.wikipedia.org/wiki/Abstract_syntax_tree).
You can play more with various other ASTs on [astexplorer.net] and read more details on their [Wikipedia article](https://en.wikipedia.org/wiki/Abstract_syntax_tree).

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/development/architecture/PACKAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ESTree is unoptimized and intended for "general purpose" use-cases of traversing
See more on configuring custom parsers with ESLint on [ESLint's User Guide > Configuring > Plugins](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser).

:::tip
You can select `@typescript-eslint/parser` on [astexplorer.net](https://astexplorer.net)'s top-middle ⚙ dropdown that defaults to Acorn.
You can select `@typescript-eslint/parser` on the [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es)'s left sidebar under _Options_ > _AST Explorer_ by selecting _ESTree_.
:::

## `@typescript-eslint/typescript-estree`
Expand Down
2 changes: 1 addition & 1 deletion docs/linting/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ See [#2041](https://github.com/typescript-eslint/typescript-eslint/issues/2041)
ESLint core contains the rule [`no-restricted-syntax`](https://eslint.org/docs/rules/no-restricted-syntax).
This generic rule allows you to specify a [selector](https://eslint.org/docs/developer-guide/selectors) for the code you want to ban, along with a custom error message.

You can use a tool like [AST Explorer](https://astexplorer.net/) to help in figuring out the structure of the AST that you want to ban.
You can use an AST visualization tool such as [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban.

For example, you can ban enums (or some variation of) using one of the following configs:

Expand Down