docs: update readme and docs about linting (#1714)

* docs: update readme about linting

* docs: update documentation
This commit is contained in:
Myriad-Dreamin 2025-04-30 14:40:36 +08:00 committed by GitHub
parent 0552d4bb4f
commit c869cde2c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 2 deletions

View file

@ -27,6 +27,7 @@
- #chapter("feature/export.typ")[Exporting Documents]
- #chapter("feature/preview.typ")[Document Preview]
- #chapter("feature/testing.typ")[Testing]
- #chapter("feature/linting.typ")[Linting]
- #chapter("feature/language.typ")[Other Features]
= Service Overview
#prefix-chapter("overview.typ")[Overview of Service]

View file

@ -54,6 +54,7 @@ Extra features:
- Compiles to PDF on save (configurable to as-you-type, or other options). Check #cross-link("/feature/export.typ")[Docs: Exporting Documents].
- Also compiles to SVG, PNG, HTML, Markdown, Text, and other formats by commands, vscode tasks, or code lenses.
- Provides test, benchmark, coverage collecting on documents and modules. Check #cross-link("/feature/testing.typ")[Docs: Testing Features].
- Provides builtin linting. Check #cross-link("/feature/linting.typ")[Docs: Linting Features].
- Provides a status bar item to show the current document's compilation status and words count.
- #link("https://github.com/Myriad-Dreamin/tinymist/tree/main/tools/editor-tools")[Editor tools]:
- View a list of templates in template gallery. (`tinymist.showTemplateGallery`)

View file

@ -0,0 +1,24 @@
#import "mod.typ": *
#show: book-page.with(title: [Linting Feature])
The linting feature is available since `tinymist` v0.13.12.
If enabled, the linter will run on save or on type, depending on your configuration. When it finishes, the language server will send the results along with the compilation diagnostics to the editor.
=== Configuring in VS Code
+ Open settings.
+ Search for "Tinymist Lint" and modify the value.
+ Toggle "Enabled" to enable or disable the linter.
+ Change "When" to configure when the linter runs.
- (Default) `onSave` run linting when you save the file.
- `onType` run linting as you type.
=== Configuring in Other Editors
+ Change configuration `tinymist.lint.enabled` to `true` to enable the linter.
+ Change configuration `tinymist.lint.when` to `onSave` or `onType` to configure when the linter runs.
- (Default) `onSave` run linting when you save the file.
- `onType` run linting as you type.

View file

@ -41,6 +41,15 @@ Tips: to enable formatting on save, you should add extra settings for typst lang
}
```
=== Configuring Linter
<configuring-linter>
+ Open settings.
+ Search for "Tinymist Lint" and modify the value.
+ Toggle "Enabled" to enable or disable the linter.
+ Change "When" to configure when the linter runs.
- (Default) `onSave` run linting when you save the file.
- `onType` run linting as you type.
=== Configuring/Using Tinymists Activity Bar (Sidebar)
<configuringusing-tinymists-activity-bar-sidebar>
If you dont like the activity bar, you can right-click on the activity bar and uncheck "Tinymist" to hide it.

View file

@ -93,7 +93,6 @@ To encourage contributions, we create many #link("https://github.com/Myriad-Drea
We are planning to implement the following features in typst v0.14.0 or spare time in weekend:
- Type checking: complete the type checker.
- Static Linter: linting code statically according to feedback of the type checker and succeeding code analysis.
- Periscope renderer: It is disabled since vscode reject to render SVGs containing foreignObjects.
- Inlay hint: It is disabled _by default_ because of performance issues.
- Find references of dictionary fields and named function arguments.
@ -107,7 +106,6 @@ We are planning to implement the following features in typst v0.14.0 or spare ti
- Search labels.
- Keep (persist) group preferences.
- Improve Typst Preview.
- Preview for all editors: See #link("https://github.com/Myriad-Dreamin/tinymist/issues/1237")[Issue 1237].
- Pin drop-down: Set the file to preview in the drop-down for clients that doesn't support passing arguments to the preview command.
- Render in web worker (another thread) to reduce overhead on the electron's main thread.
- #strike[Spell checking: There is already a branch but no suitable (default) spell checking library is found.]

View file

@ -40,6 +40,15 @@ Tips: to enable formatting on save, you should add extra settings for typst lang
}
```
### Configuring Linter
1. Open settings.
1. Search for "Tinymist Lint" and modify the value.
1. Toggle "Enabled" to enable or disable the linter.
1. Change "When" to configure when the linter runs.
- (Default) `onSave` run linting when you save the file.
- `onType` run linting as you type.
### Configuring/Using Tinymists Activity Bar (Sidebar)
If you dont like the activity bar, you can right-click on the activity bar and uncheck "Tinymist" to hide it.