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
TSSLint provides compatibility layers for existing linter ecosystems. The integration functions are available via`@tsslint/config`, and you only need to install the original linter package to use them.
178
+
TSSLint provides compatibility layers for existing linter ecosystems (ESLint, TSLint, and TSL). These integrations are coordinated through`@tsslint/config`, which acts as a bridge to load rules from other linters.
179
179
180
-
#### ESLint
180
+
To use a compatibility layer, you must install the corresponding TSSLint compatibility package. If you wish to use the original linter's built-in rules, you must also install the original linter package itself.
181
+
182
+
#### 1. ESLint
183
+
184
+
**Installation:**
185
+
186
+
First, install the TSSLint compatibility package for ESLint.
187
+
188
+
```bash
189
+
npm install @tsslint/compat-eslint --save-dev
190
+
```
191
+
192
+
If you want to use ESLint's built-in rules (e.g., `no-unused-vars`), you must also install `eslint` (optional):
After installing the original linter package, run the following command to update JSDoc for built-in rules, enabling better IDE support:
201
+
202
+
```bash
203
+
npx tsslint-docgen
204
+
```
205
+
206
+
**Usage in `tsslint.config.ts`:**
207
+
208
+
Use `importESLintRules` to load rules. This function automatically resolves and loads rules from ESLint plugins (e.g., `@typescript-eslint/eslint-plugin`) by searching your `node_modules`. Plugin rules are identified by their prefix (e.g., `@typescript-eslint/`).
`importESLintRules` will automatically resolve and load rules from ESLint plugins (e.g., `@typescript-eslint/eslint-plugin`) by searching your `node_modules`. Plugin rules are identified by their prefix (e.g., `@typescript-eslint/`).
223
+
#### 2. TSLint
224
+
225
+
**Installation:**
200
226
201
-
#### TSLint
227
+
If you want to use TSLint's built-in rules, you need to install `tslint` (optional):
202
228
203
229
```bash
204
230
npm install tslint --save-dev
205
231
```
206
232
233
+
**Type Definition Update:**
234
+
235
+
After installing `tslint`, run the following command to update JSDoc for built-in rules:
236
+
237
+
```bash
238
+
npx tsslint-docgen
239
+
```
240
+
241
+
**Usage in `tsslint.config.ts`:**
242
+
243
+
Use `importTSLintRules` to load rules. This function automatically reads `rulesDirectory` from your `tslint.json` to support third-party TSLint plugins.
0 commit comments