@effect/language-service 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -2
- package/cli.js +5806 -456
- package/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -156,7 +156,7 @@ If everything goes smoothly, something along these lines should be printed out:
|
|
|
156
156
|
/node_modules/typescript/lib/_tsc.js patched successfully.
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
Now the CLI has patched the tsc binary and the typescript library to raise
|
|
159
|
+
Now the CLI has patched the tsc binary and the typescript library to raise Effect diagnostics even at build time if the plugin is configured in your tsconfig!
|
|
160
160
|
|
|
161
161
|
As the command output suggests, you may need to delete your tsbuildinfo files or perform a full rebuild in order to re-check previously existing files.
|
|
162
162
|
|
|
@@ -204,13 +204,29 @@ index.ts:3:1 - error TS3: Effect must be yielded or assigned to a variable.
|
|
|
204
204
|
Found 1 error in index.ts:3
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
+
## Effect-Language-Service CLI
|
|
208
|
+
|
|
209
|
+
The effect language service plugin comes with a builtin CLI tool that can be used to perform various utilities, checks and setups. Since it relies on typescript, we recommend to install it locally and run it locally to ensure it loads the same typescript version of your project rather than a global installation that may resolve to use a different TS version from the one of your project.
|
|
210
|
+
|
|
211
|
+
### `effect-language-service diagnostics`
|
|
212
|
+
Provides a way to get through a CLI the list of Effect specific diagnostics; without patching your typescript installation. A --file option may be used to get diagnostics for a specific file, or --project with a tsconfig file to get an entire project.
|
|
213
|
+
|
|
214
|
+
### `effect-language-service check`
|
|
215
|
+
This command runs a check of the setup of the patching mechanism of the LSP, to understand if typescript has been patched or not.
|
|
216
|
+
|
|
217
|
+
### `effect-language-service patch`
|
|
218
|
+
Patches (or re-patches) your local TypeScript installation to provide Effect diagnostics at build time.
|
|
219
|
+
|
|
220
|
+
### `effect-language-service unpatch`
|
|
221
|
+
Revery any previously applied patch to the local TypeScript installation.
|
|
222
|
+
|
|
207
223
|
## Configuring diagnostics
|
|
208
224
|
|
|
209
225
|
You can either disable or change the severity of specific diagnostics by using comments in your code.
|
|
210
226
|
|
|
211
227
|
```ts
|
|
212
228
|
// @effect-diagnostics effect/floatingEffect:off
|
|
213
|
-
Effect.succeed(1); // This will not be reported as a floating
|
|
229
|
+
Effect.succeed(1); // This will not be reported as a floating Effect
|
|
214
230
|
|
|
215
231
|
// @effect-diagnostics effect/floatingEffect:error
|
|
216
232
|
Effect.succeed(1); // This will be reported as a floating effect
|
|
@@ -305,6 +321,7 @@ and will be used as follows:
|
|
|
305
321
|
export class UserRepo extends Repository("Hello")<UserRepo, { /** ... */ }>() {}
|
|
306
322
|
```
|
|
307
323
|
|
|
324
|
+
|
|
308
325
|
## Known gotchas
|
|
309
326
|
|
|
310
327
|
### Svelte VSCode extension and SvelteKit
|