Docs Party 2024 (#15876)
Co-authored-by: Raunak Raj <nkray21111983@gmail.com> Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com> Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Jason <jason@zed.dev> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Jason Mancuso <7891333+jvmncs@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
co-authored by
Raunak Raj
Thorsten Ball
Bennet
Marshall Bowers
Joseph T Lyons
Mikayla
Jason
Antonio Scandurra
Max Brunsfeld
Marshall
Nathan Sobo
Jason Mancuso
Piotr Osiewicz
parent
c633fa5a10
commit
eb3c4b0e46
@@ -2,10 +2,10 @@
|
||||
|
||||
JavaScript support is available natively in Zed.
|
||||
|
||||
- Tree Sitter: [tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript)
|
||||
- Language Server: [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)
|
||||
- Tree Sitter: [tree-sitter/tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript)
|
||||
- Language Server: [typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)
|
||||
|
||||
### Code formatting
|
||||
## Code formatting
|
||||
|
||||
Formatting on save is enabled by default for JavaScript, using TypeScript's built-in code formatting. But many JavaScript projects use other command-line code-formatting tools, such as [Prettier](https://prettier.io/). You can use one of these tools by specifying an _external_ code formatter for JavaScript in your settings. See the [configuration](../configuring-zed.md) documentation for more information.
|
||||
|
||||
@@ -26,10 +26,20 @@ For example, if you have Prettier installed and on your `PATH`, you can use it t
|
||||
}
|
||||
```
|
||||
|
||||
### ESLint
|
||||
## JSX
|
||||
|
||||
TBD: Mention JSX
|
||||
|
||||
## JSDoc
|
||||
|
||||
TBD: Document JSDoc support in Zed.
|
||||
|
||||
- Tree Sitter: [tree-sitter/tree-sitter-jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc)
|
||||
|
||||
## ESLint
|
||||
|
||||
You can configure Zed to format code using `eslint --fix` by running the ESLint
|
||||
code action when formatting (requires Zed `0.125.0`):
|
||||
code action when formatting:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -72,7 +82,7 @@ You can also only execute a single ESLint rule when using `fixAll`:
|
||||
> errors.
|
||||
|
||||
If you **only** want to run ESLint on save, you can configure code actions as
|
||||
the formatter (requires Zed `0.130.x`):
|
||||
the formatter:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -88,9 +98,9 @@ the formatter (requires Zed `0.130.x`):
|
||||
}
|
||||
```
|
||||
|
||||
#### Configure ESLint's `nodePath`:
|
||||
### Configure ESLint's `nodePath`:
|
||||
|
||||
You can configure ESLint's `nodePath` setting (requires Zed `0.127.0`):
|
||||
You can configure ESLint's `nodePath` setting:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -104,9 +114,9 @@ You can configure ESLint's `nodePath` setting (requires Zed `0.127.0`):
|
||||
}
|
||||
```
|
||||
|
||||
#### Configure ESLint's `problems`:
|
||||
### Configure ESLint's `problems`:
|
||||
|
||||
You can configure ESLint's `problems` setting (requires Zed `0.130.x`).
|
||||
You can configure ESLint's `problems` setting.
|
||||
|
||||
For example, here's how to set `problems.shortenToSingleLine`:
|
||||
|
||||
@@ -124,7 +134,7 @@ For example, here's how to set `problems.shortenToSingleLine`:
|
||||
}
|
||||
```
|
||||
|
||||
#### Configure ESLint's `rulesCustomizations`:
|
||||
### Configure ESLint's `rulesCustomizations`:
|
||||
|
||||
You can configure ESLint's `rulesCustomizations` setting:
|
||||
|
||||
@@ -143,6 +153,7 @@ You can configure ESLint's `rulesCustomizations` setting:
|
||||
}
|
||||
```
|
||||
|
||||
## Yarn integration
|
||||
## See also
|
||||
|
||||
See [Yarn documentation](./yarn.md) for a walkthrough of configuring your project to use Yarn.
|
||||
- [Yarn documentation](./yarn.md) for a walkthrough of configuring your project to use Yarn.
|
||||
- [TypeScript documentation](./typescript.md)
|
||||
|
||||
Reference in New Issue
Block a user