You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A linter that runs inside `tsserver`. No separate process, no re-parsing, no ESTree conversion. It uses the TypeChecker your editor already has.
14
+
A linter that runs as a `tsserver` plugin. It reuses the TypeChecker your editor already has — no second process, no AST conversion, no duplicated type-checking.
15
15
16
-
Zero built-in rules. You write what you need with the full TypeScript compiler API.
16
+
Zero built-in rules. Rules are plain functions over the TypeScript compiler API.
17
17
18
18
## Why?
19
19
20
-
ESLint works, but it runs separately and sets up its own type-checking. On large projects, "Auto Fix on Save" gets laggy.
20
+
ESLint runs in its own process and builds its own type information. On large projects this makes "Auto Fix on Save" slow.
21
21
22
-
TSSLint avoids this by running as a `tsserver` plugin. It reuses the existing TypeChecker, works on native TypeScript AST, and skips the parser conversion layer.
22
+
TSSLint piggybacks on `tsserver`. Diagnostics show up in the same path TypeScript errors do, using the same `Program` instance.
TSLint (TS-AST, deprecated 2019) → ESLint took over via `typescript-eslint` → TSSLint revives the in-process TS-AST approach as a `tsserver` plugin (2023).
'no-debugger': debuggerRule, // reported as "style/no-debugger"
157
+
},
158
+
},
159
+
});
160
+
```
161
+
162
+
`defineConfig` also accepts an array — each entry can scope rules with `include` / `exclude` minimatch patterns.
74
163
75
164
### Caching
76
165
77
-
Diagnostics are cached by default. The cache invalidates automatically when:
166
+
By default, rules run in a syntax-only mode and their diagnostics are cached on disk under `os.tmpdir()/tsslint-cache/`. Cache is keyed by file mtime.
167
+
168
+
The moment a rule reads `ctx.program`, it switches to type-aware mode for that file and skips the cache (type information depends on more than one file's mtime). To opt a single diagnostic out of caching without going type-aware, call `.withoutCache()` on the reporter.
78
169
79
-
1. A rule accesses `RuleContext.program` (type-aware rules)
80
-
2. A rule calls `report().withoutCache()`
170
+
Pass `--force` to the CLI to ignore the cache.
81
171
82
172
### Debugging
83
173
84
-
Every `report()` captures a stack trace. Click the diagnostic in your editor to jump to the exact line in your rule that triggered it.
174
+
Every `report()` captures a stack trace. The diagnostic carries a "Related Information" link back to the exact line in your rule that triggered it — ⌘-click in the editor to jump there:
|`--filter <glob...>`| Restrict to matching files |
206
+
|`--fix`| Apply fixes |
207
+
|`--force`| Ignore cache |
208
+
|`--failures-only`| Only print diagnostics that affect exit code |
209
+
|`-h`, `--help`||
101
210
102
-
## Framework Support
211
+
TSSLint produces diagnostics and edits — it does not format. Run dprint or Prettier after `--fix`.
103
212
104
-
TSSLint works with Vue, MDX, Astro, and anything else that plugs into tsserver. These tools virtualize their files as TypeScript for tsserver. TSSLint just sees and lints that TypeScript.
The `--*-project` flags wire in [Volar](https://volarjs.dev/) language plugins so framework files (Vue SFCs, MDX, Astro components, etc.) are virtualized as TypeScript before linting. Anything `tsserver` can see, TSSLint can lint.
0 commit comments