Skip to content

Commit dc38f05

Browse files
committed
docs: restructure README for better information architecture and flow
1 parent e2b9b74 commit dc38f05

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ TSSLint is architecturally optimized for TypeScript by running directly as a `ts
2424
## Key Features
2525

2626
* **Project-Centric**: Treats the **Project (tsconfig)** as a first-class citizen. This aligns with TypeScript's internal architecture, enabling efficient cross-file type analysis and seamless support for complex monorepos.
27-
* **Zero Assumptions**: Comes with no built-in rules. It does not enforce any specific coding style or patterns, leaving full control to the developer.
2827
* **High Performance**: Runs as a `tsserver` plugin, sharing the existing `TypeChecker` instance to avoid redundant parsing and type-checking.
29-
* **Low Noise**: Violations are reported as "Message" diagnostics, ensuring they don't interfere with actual compiler errors or warnings.
28+
* **Zero Assumptions**: Comes with no built-in rules. It does not enforce any specific coding style or patterns, leaving full control to the developer.
3029
* **Direct AST Access**: Rule authoring uses native TypeScript APIs directly, without unnecessary abstraction layers.
30+
* **Low Noise**: Violations are reported as "Message" diagnostics, ensuring they don't interfere with actual compiler errors or warnings.
3131

3232
## How It Works
3333

@@ -47,6 +47,8 @@ In editors like VSCode, when using extensions like **Vue Official (Volar)**, **M
4747
<img src="architecture_v2.png" alt="TSSLint Framework Support Diagram" width="700">
4848
</p>
4949

50+
---
51+
5052
## Getting Started
5153

5254
### 1. Install
@@ -88,7 +90,11 @@ export default defineConfig({
8890
}
8991
```
9092

91-
## Rule Example
93+
---
94+
95+
## Rule Authoring
96+
97+
### Rule Example
9298

9399
```ts
94100
// rules/no-debugger.ts
@@ -108,7 +114,7 @@ export default defineRule(({ typescript: ts, file, report }) => {
108114
});
109115
```
110116

111-
## Rule Caching Mechanism
117+
### Rule Caching Mechanism
112118

113119
TSSLint's high performance is partly due to its intelligent caching strategy, which automatically distinguishes between **Syntax-Aware** and **Type-Aware** rules.
114120

@@ -119,6 +125,8 @@ By default, all rule diagnostics are cached. However, the cache is automatically
119125

120126
This automatic differentiation allows TSSLint to maximize performance for simple syntax rules while maintaining correctness for complex type-aware rules.
121127

128+
---
129+
122130
## CLI Usage
123131

124132
The `@tsslint/cli` package provides a command-line tool for CI/CD and build processes.
@@ -137,10 +145,15 @@ npx tsslint --project packages/*/tsconfig.json --vue-project apps/web/tsconfig.j
137145
npx tsslint --project {tsconfig.json,packages/*/tsconfig.json,extensions/*/tsconfig.json}
138146
```
139147

148+
> [!NOTE]
149+
> **CLI Caching**: The CLI uses a file system cache to speed up subsequent runs. The cache files are stored in your operating system's temporary directory (`os.tmpdir()`) to avoid polluting your project's file system. The cache path includes the TSSLint version and a project-specific hash to prevent conflicts. The cache is automatically invalidated when the project's `tsslint.config.ts`, the CLI arguments, or the TSSLint version changes.
150+
140151
> [!TIP]
141152
> TSSLint focuses on diagnostic fixes and does not include a built-in formatter. It is recommended to run a dedicated formatter like **Prettier**, **dprint**, or **oxfmt** after running TSSLint with `--fix`.
142153
143-
## Extensions
154+
---
155+
156+
## Extensions & Ecosystem
144157

145158
### Ignoring Rules
146159
```ts
@@ -158,6 +171,8 @@ export default defineConfig({
158171
* **ESLint**: Convert rules via `@tsslint/eslint`.
159172
* **TSLint**: Convert rules via `@tsslint/tslint`.
160173

174+
---
175+
161176
## Technical Notes
162177

163178
* **Node.js**: Requires 22.6.0+ (v3.0+).

0 commit comments

Comments
 (0)