@marcrock22/veslint 0.38.1 → 0.40.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.
Files changed (2) hide show
  1. package/README.md +106 -7
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -8,13 +8,104 @@
8
8
 
9
9
  # veslint
10
10
 
11
- veslint lints TypeScript with ESLint's rules, without ESLint. It parses with tree-sitter, gets the types from the native TypeScript 7 compiler, and needs no JavaScript runtime to lint.
11
+ veslint lints TypeScript with ESLint's rules, without ESLint. It parses with tree-sitter, gets the types from the native TypeScript 7 compiler linked into veslint itself, and needs no JavaScript runtime to lint.
12
12
 
13
- - **Same results as ESLint.** The rules of ESLint, typescript-eslint, eslint-plugin-unicorn, @stylistic/eslint-plugin, eslint-plugin-perfectionist, @eslint-community/eslint-plugin-eslint-comments, eslint-plugin-promise and @slipher/eslint-plugin are ported to V. They report the same problems, with the same messages, positions, fixes and suggestions.
13
+ - **Same results as ESLint.** The rules of ESLint, typescript-eslint, eslint-plugin-unicorn, @stylistic/eslint-plugin, eslint-plugin-perfectionist, @eslint-community/eslint-plugin-eslint-comments, eslint-plugin-promise, eslint-plugin-regexp and @slipher/eslint-plugin are ported to V. They report the same problems, with the same messages, positions, fixes and suggestions.
14
14
  - **Your ESLint configuration.** veslint reads `eslint.config.*`, the directive comments (`// eslint-disable-next-line`, `/* eslint rule: … */`, `/* global */`) and rule options. A rule it does not have yet is skipped with a warning.
15
- - **Fast.** On a Discord bot of 65 TypeScript files, the 105 typescript-eslint rules in one run take 3.2 s with veslint and 11.7 s with ESLint (one core of an old i3). In the editor, a file is linted again about 0.1 s after you type.
15
+ - **Fast.** 4 to 10 times faster than ESLint on whole projects with the same results, and faster than ESLint and oxlint at re-linting a file with type-aware rules as you type (see [Speed](#speed)).
16
16
  - **An editor extension** for VS Code shows the problems as you type, with quick fixes.
17
17
 
18
+ ## Speed
19
+
20
+ ![The 23 type-aware rules of recommendedTypeChecked, on the command line](docs/bench/typed.svg)
21
+
22
+ ![The 23 type-aware rules of recommendedTypeChecked, in the editor](docs/bench/editor-typed.svg)
23
+
24
+ - **Against ESLint** (with typescript-eslint), veslint reports exactly the same problems, 4 to 10 times faster on whole projects, with less memory in most cases.
25
+ - **In the editor**, re-linting a file after an edit with type-aware rules, veslint is faster than ESLint and oxlint on every project measured (Biome has 3 of the 23 rules, so it is left out).
26
+ - **On the command line**, oxlint is faster in most cases (veslint is faster with the 23 type-aware rules on recharts and with no-floating-promises on zod), and Biome too without types. Neither reports the same problems as ESLint: the charts and the table say how many of ESLint's problems each one finds.
27
+
28
+ <details>
29
+ <summary>The other charts: <code>no-floating-promises</code> alone, and rules without types</summary>
30
+
31
+ ![no-floating-promises, on the command line](docs/bench/floating.svg)
32
+
33
+ ![Rules without types, on the command line](docs/bench/syntactic.svg)
34
+
35
+ ![Rules without types, in the editor](docs/bench/editor-syntactic.svg)
36
+
37
+ </details>
38
+
39
+ <details>
40
+ <summary>Every measure</summary>
41
+
42
+ **56 rules of @eslint/js and typescript-eslint recommended**
43
+
44
+ | Project | Tool | Time | CPU time | Memory | Problems | Same as ESLint | Editor: first lint | Editor: after an edit |
45
+ |---|---|---:|---:|---:|---:|---:|---:|---:|
46
+ | zod | ESLint | 4.1 s ± 0.05 s | 8.1 s | 466 MiB | 972 | — | 1543 ms | 336 ms |
47
+ | zod | **veslint** | 0.53 s ± 0.00 s | 1.00 s | 139 MiB | 972 | 972 of 972 | 938 ms | 111 ms |
48
+ | zod | oxlint | 0.09 s ± 0.00 s | 0.14 s | 117 MiB | 924 | 895 of 972 | 157 ms | 92 ms |
49
+ | zod | Biome | 0.42 s ± 0.00 s | 0.88 s | 205 MiB | 941 | 887 of 972 | 153 ms | 350 ms |
50
+ | recharts | ESLint | 4.3 s ± 0.03 s | 8.6 s | 455 MiB | 380 | — | 1128 ms | 133 ms |
51
+ | recharts | **veslint** | 0.54 s ± 0.01 s | 1.0 s | 141 MiB | 380 | 380 of 380 | 947 ms | 64 ms |
52
+ | recharts | oxlint | 0.08 s ± 0.00 s | 0.15 s | 111 MiB | 362 | 331 of 380 | 114 ms | 3.4 ms |
53
+ | recharts | Biome | 0.27 s ± 0.00 s | 0.76 s | 134 MiB | 375 | 362 of 380 | 135 ms | 305 ms |
54
+ | TypeScript compiler | ESLint | 24 s ± 0.20 s | 43 s | 1,113 MiB | 1,330 | — | 1956 ms | 632 ms |
55
+ | TypeScript compiler | **veslint** | 5.3 s ± 0.09 s | 10 s | 650 MiB | 1,330 | 1,330 of 1,330 | 1559 ms | 342 ms |
56
+ | TypeScript compiler | oxlint | 0.37 s ± 0.01 s | 0.79 s | 179 MiB | 1,012 | 957 of 1,330 | 179 ms | 111 ms |
57
+ | TypeScript compiler | Biome | 1.9 s ± 0.03 s | 5.9 s | 513 MiB | 1,288 | 879 of 1,330 | 204 ms | 383 ms |
58
+
59
+ **no-floating-promises**
60
+
61
+ | Project | Tool | Time | CPU time | Memory | Problems | Same as ESLint | Editor: first lint | Editor: after an edit |
62
+ |---|---|---:|---:|---:|---:|---:|---:|---:|
63
+ | zod | ESLint | 6.1 s ± 0.05 s | 12 s | 791 MiB | 1 | — | — | — |
64
+ | zod | **veslint** | 0.59 s ± 0.00 s | 1.1 s | 216 MiB | 1 | 1 of 1 | — | — |
65
+ | zod | oxlint | 0.60 s ± 0.02 s | 1.8 s | 292 MiB | 1 | 1 of 1 | — | — |
66
+ | zod | Biome | 0.47 s ± 0.01 s | 1.5 s | 174 MiB | 1 | 1 of 1 | — | — |
67
+ | recharts | ESLint | 7.7 s ± 0.05 s | 16 s | 954 MiB | 0 | — | — | — |
68
+ | recharts | **veslint** | 0.73 s ± 0.01 s | 1.4 s | 273 MiB | 0 | 0 of 0 | — | — |
69
+ | recharts | oxlint | 0.70 s ± 0.02 s | 2.5 s | 331 MiB | 0 | 0 of 0 | — | — |
70
+ | recharts | Biome | 0.45 s ± 0.01 s | 1.5 s | 170 MiB | 0 | 0 of 0 | — | — |
71
+ | TypeScript compiler | ESLint | 32 s ± 0.21 s | 61 s | 1,887 MiB | 2 | — | — | — |
72
+ | TypeScript compiler | **veslint** | 4.1 s ± 0.03 s | 7.7 s | 866 MiB | 2 | 2 of 2 | — | — |
73
+ | TypeScript compiler | oxlint | 1.9 s ± 0.06 s | 6.8 s | 685 MiB | 2 | 2 of 2 | — | — |
74
+ | TypeScript compiler | Biome | 3.0 s ± 0.01 s | 12 s | 429 MiB | 2 | 2 of 2 | — | — |
75
+
76
+ **the 23 type-aware rules of recommendedTypeChecked**
77
+
78
+ | Project | Tool | Time | CPU time | Memory | Problems | Same as ESLint | Editor: first lint | Editor: after an edit |
79
+ |---|---|---:|---:|---:|---:|---:|---:|---:|
80
+ | zod | ESLint | 13 s ± 0.11 s | 24 s | 1,033 MiB | 1,376 | — | 3841 ms | 1111 ms |
81
+ | zod | **veslint** | 2.4 s ± 0.01 s | 4.5 s | 507 MiB | 1,376 | 1,376 of 1,376 | 1257 ms | 346 ms |
82
+ | zod | oxlint | 1.8 s ± 0.05 s | 5.3 s | 476 MiB | 1,357 | 1,304 of 1,376 | 516 ms | 439 ms |
83
+ | recharts | ESLint | 22 s ± 0.06 s | 38 s | 1,247 MiB | 175 | — | 5027 ms | 1198 ms |
84
+ | recharts | **veslint** | 4.4 s ± 0.02 s | 8.4 s | 977 MiB | 175 | 175 of 175 | 1230 ms | 286 ms |
85
+ | recharts | oxlint | 4.5 s ± 0.05 s | 14 s | 884 MiB | 175 | 168 of 175 | 636 ms | 540 ms |
86
+ | TypeScript compiler | ESLint | 73 s ± 1.9 s | 116 s | 2,086 MiB | 3,790 | — | 8643 ms | 2355 ms |
87
+ | TypeScript compiler | **veslint** | 16 s ± 0.15 s | 31 s | 2,421 MiB | 3,790 | 3,790 of 3,790 | 2388 ms | 893 ms |
88
+ | TypeScript compiler | oxlint | 6.4 s ± 0.34 s | 23 s | 1,101 MiB | 3,784 | 2,980 of 3,790 | 1617 ms | 1536 ms |
89
+
90
+ </details>
91
+
92
+ <details>
93
+ <summary>How it was measured</summary>
94
+
95
+ `tests/bench/run.sh` (2026-11-20, `docs/bench/results.json`) on an Intel Core i3-4150T (2 cores, 4 threads, 12 GB, Linux), with veslint 0.40.0 (TypeScript 7.1.0-beta), ESLint 10.15.0 with typescript-eslint 8.72.2 and TypeScript 6.0.3, oxlint 1.94.0 with oxlint-tsgolint 7.0.2007, and Biome 2.6.8.
96
+
97
+ - **Projects:** zod, recharts and the TypeScript compiler's sources, each linted with one `tsconfig.json`, the same files for every tool.
98
+ - **Rules:**
99
+ - the 23 rules of typescript-eslint's `recommendedTypeChecked` that need types (Biome has 3 of them, so it is left out);
100
+ - `no-floating-promises` alone (Biome's `noFloatingPromises` infers types itself, without TypeScript);
101
+ - the 56 rules of `@eslint/js` and typescript-eslint `recommended` that every tool has (Biome's names from `biome migrate eslint`).
102
+ - **Command line:** hyperfine, 5 runs after a warmup, each tool with its default threads. ESLint and veslint read the same `eslint.config.mjs`.
103
+ - **Editor:** each tool's long-lived process opens one large file and re-lints it after each of 10 edits of unsaved text: `veslint --server`, ESLint kept alive as its VS Code extension keeps it, `oxlint --lsp` and `biome lsp-proxy`.
104
+ - **Memory:** the peak of all the processes of a run (veslint and oxlint each run two).
105
+ - **Same as ESLint:** the problems at the same place for the same rule.
106
+
107
+ </details>
108
+
18
109
  ## Install
19
110
 
20
111
  ### VS Code
@@ -92,7 +183,7 @@ With files and neither `--config` nor `--rule`, veslint prints the type TypeScri
92
183
 
93
184
  The exit code is 0 when there are no problems, 1 when there are (warnings do not count, as in ESLint) or veslint failed, and 2 for a usage error.
94
185
 
95
- Environment variables: `VESLINT_TIMEOUT_MS` (how long to wait for each answer of the TypeScript compiler, 30000 by default), `VESLINT_CPUS` (how many CPUs veslint and the compiler use: 2 by default, which is fastest; 0 for all) and `VESLINT_CONFIG_CACHE` (`0` resolves the `eslint.config.*` again on every run, see [Configuration](#configuration)).
186
+ Environment variables: `VESLINT_CPUS` (how many CPUs veslint and the compiler use: by default one of each core, and 2 for `--server` or with `VESLINT_TSGO=process`; 0 for all. A run lints its files on that many threads when it has at least 8 files per thread; with the compiler linked into veslint the threads share its program and each has its own type checker, whose types make memory grow with them), `VESLINT_TSGO` (`process` runs the TypeScript compiler of the npm package as a separate process instead of the one linked into veslint), `VESLINT_TIMEOUT_MS` (with `VESLINT_TSGO=process`: how long to wait for each answer of the compiler, 30000 by default) and `VESLINT_CONFIG_CACHE` (`0` resolves the `eslint.config.*` again on every run, see [Configuration](#configuration)).
96
187
 
97
188
  ## Configuration
98
189
 
@@ -114,7 +205,7 @@ Directive comments work as in ESLint 10: `eslint-disable`, `eslint-enable`, `esl
114
205
 
115
206
  ## Rules
116
207
 
117
- veslint has **825 rules**, each with all its options, fixes and suggestions:
208
+ veslint has **847 rules**, each with all its options, fixes and suggestions:
118
209
 
119
210
  <details>
120
211
  <summary><b>ESLint 10.15.0</b>: 139 rules</summary>
@@ -165,6 +256,13 @@ veslint has **825 rules**, each with all its options, fixes and suggestions:
165
256
 
166
257
  </details>
167
258
 
259
+ <details>
260
+ <summary><b>eslint-plugin-regexp 3.3.3</b>: 22 rules (3 of them use types)</summary>
261
+
262
+ `regexp/control-character-escape`, `regexp/grapheme-string-literal`, `regexp/hexadecimal-escape`, `regexp/letter-case`, `regexp/no-control-character`, `regexp/no-empty-alternative`, `regexp/no-empty-group`, `regexp/no-empty-string-literal`, `regexp/no-escape-backspace`, `regexp/no-extra-lookaround-assertions`, `regexp/no-invalid-regexp`, `regexp/no-invisible-character`, `regexp/no-lazy-ends`, `regexp/no-legacy-features`, `regexp/no-missing-g-flag`, `regexp/no-non-standard-flag`, `regexp/no-obscure-range`, `regexp/no-octal`, `regexp/no-standalone-backslash`, `regexp/no-trivially-nested-quantifier`, `regexp/no-useless-character-class`, `regexp/no-useless-dollar-replacements`
263
+
264
+ </details>
265
+
168
266
  <details>
169
267
  <summary><b>eslint-plugin-vue 10.12.1</b> (the templates and scripts of <code>.vue</code> files, and the components of TypeScript files): 256 rules</summary>
170
268
 
@@ -201,7 +299,7 @@ What each version added is in the [changelog](CHANGELOG.md).
201
299
 
202
300
  ### How it is checked
203
301
 
204
- Every rule passes all the cases of its own upstream tests, linted as TypeScript: 29,862 cases of typescript-eslint, 14,092 of ESLint, 14,962 of eslint-plugin-unicorn, 9,528 of @stylistic/eslint-plugin, 3,278 of eslint-plugin-perfectionist, 204 of @eslint-community/eslint-plugin-eslint-comments, 522 of eslint-plugin-promise, 459 of @slipher/eslint-plugin, 206 of @marcrock22/eslintcf, 10,085 of eslint-plugin-vue and 1,090 of eslint-plugin-svelte (their JavaScript cases with `lang="ts"`, with what ESLint gives for them). On fixtures of its own, every rule gives exactly what ESLint gives: problems, messages, positions, fixes and suggestions. The rules are also compared with ESLint on real projects (a Discord bot, zod, recharts and the TypeScript compiler).
302
+ Every rule passes all the cases of its own upstream tests, linted as TypeScript: 29,862 cases of typescript-eslint, 14,092 of ESLint, 14,962 of eslint-plugin-unicorn, 9,528 of @stylistic/eslint-plugin, 3,278 of eslint-plugin-perfectionist, 204 of @eslint-community/eslint-plugin-eslint-comments, 522 of eslint-plugin-promise, 572 of eslint-plugin-regexp, 459 of @slipher/eslint-plugin, 206 of @marcrock22/eslintcf, 10,085 of eslint-plugin-vue and 1,090 of eslint-plugin-svelte (their JavaScript cases with `lang="ts"`, with what ESLint gives for them). On fixtures of its own, every rule gives exactly what ESLint gives: problems, messages, positions, fixes and suggestions. The rules are also compared with ESLint on real projects (a Discord bot, zod, recharts and the TypeScript compiler).
205
303
 
206
304
  ## VS Code extension
207
305
 
@@ -223,6 +321,7 @@ Requirements:
223
321
 
224
322
  - [V](https://github.com/vlang/v) at commit `841595141fbb` (the release workflow builds it from the vlang/vc commit `45add16eb714`).
225
323
  - GCC, `make`, `git`, `patch` and `npm`. npm only downloads two pinned binaries: TypeScript 7.1.0-beta and the tree-sitter 0.24.4 CLI.
324
+ - [Go](https://go.dev) 1.27 (with cgo): TypeScript is linked into veslint, built from the Go sources of the commit of TypeScript 7.1.0-beta (`tsgo/inproc/build.sh` fetches them into `build/upstream/typescript-go`). At run time veslint needs nothing else; `VESLINT_TSGO=process` runs the `tsc --api` binary of the npm package instead, over a pipe.
226
325
 
227
326
  ```sh
228
327
  make deps # TypeScript 7, tree-sitter and the patched TypeScript grammar
@@ -231,7 +330,7 @@ make test V=<v> # the tests (JOBS=<n> checks at once; the CPUs by default)
231
330
  VESLINT_MATRIX=1 make test V=<v> # also each rule alone on every fixture (before a release)
232
331
  ```
233
332
 
234
- **Windows:** run `pwsh ./build-windows.ps1` with PowerShell 7, Git for Windows, MSYS2's UCRT64 gcc in `PATH` (`pacman -S mingw-w64-ucrt-x86_64-gcc`) and Node.js. It builds V and the dependencies itself; the generated grammar is copied from a Linux checkout of the same commit (`build/tree-sitter-typescript`, which `make` writes).
333
+ **Windows:** run `pwsh ./build-windows.ps1` with PowerShell 7, Git for Windows, MSYS2's UCRT64 gcc in `PATH` (`pacman -S mingw-w64-ucrt-x86_64-gcc`), Go 1.27 and Node.js. It builds V and the dependencies itself; the generated grammar is copied from a Linux checkout of the same commit (`build/tree-sitter-typescript`, which `make` writes).
235
334
 
236
335
  ## Changelog
237
336
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcrock22/veslint",
3
- "version": "0.38.1",
3
+ "version": "0.40.0",
4
4
  "description": "A TypeScript linter in V that talks to TypeScript 7 (tsc --api) directly: the rules of ESLint, typescript-eslint, unicorn, @stylistic, perfectionist and seyfert, with the same results.",
5
5
  "bin": {
6
6
  "veslint": "bin/veslint.js"
@@ -9,8 +9,8 @@
9
9
  "bin"
10
10
  ],
11
11
  "optionalDependencies": {
12
- "@marcrock22/veslint-linux-x64": "0.38.1",
13
- "@marcrock22/veslint-win32-x64": "0.38.1"
12
+ "@marcrock22/veslint-linux-x64": "0.40.0",
13
+ "@marcrock22/veslint-win32-x64": "0.40.0"
14
14
  },
15
15
  "keywords": [
16
16
  "typescript",