@darraghor/eslint-plugin-nestjs-typed 6.1.0 → 6.1.1
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 +25 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,23 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
+
# NestJS Eslint Plugin
|
|
8
|
+
|
|
9
|
+
If you use NestJs (https://nestjs.com/) these ESLint rules will help you to prevent common bugs and issues in NestJs applications.
|
|
10
|
+
|
|
11
|
+
Skip to [How to configure](#to-configure) but if you have issues come back and read this whole document.
|
|
12
|
+
|
|
13
|
+
## Support this plugin
|
|
14
|
+
|
|
15
|
+
If you use this plugin in commercial setting consider submitting PRs on work time. It saves your business money, so it makes your business money!
|
|
16
|
+
|
|
17
|
+
If you really want to support me directly you can use https://www.buymeacoffee.com/darraghor
|
|
18
|
+
|
|
19
|
+
But please, just submit PRs to help all NestJS devs. This is the way.
|
|
20
|
+
|
|
7
21
|
## A note on versions
|
|
8
22
|
|
|
9
|
-
- Version `6.x` supports Eslint version `>=9.x` and typescript eslint parser `^8`
|
|
23
|
+
- Version `6.x` supports Eslint version `>=9.x` and typescript eslint parser `^7` and `^8`
|
|
10
24
|
- Version `5.x` supports Eslint version `>=8.x` and typescript eslint parser `^7` and `^8`
|
|
11
25
|
- Version `4.x` supports Eslint version `>=8.x` and typescript eslint parser `^6`
|
|
12
26
|
- Version `3.x` supports Eslint version `>=8.x` and typescript eslint parser `^5`
|
|
@@ -163,20 +177,15 @@ For ESlint 8 I export the old style config in the "classicConfig" export.
|
|
|
163
177
|
|
|
164
178
|
I believe it would work something like this...
|
|
165
179
|
|
|
166
|
-
|
|
167
|
-
import {
|
|
168
|
-
classicPlugin,
|
|
169
|
-
} from "@darraghor/eslint-plugin-nestjs-typed";
|
|
170
|
-
|
|
180
|
+
```ts
|
|
181
|
+
import {classicPlugin} from "@darraghor/eslint-plugin-nestjs-typed";
|
|
171
182
|
|
|
172
183
|
module.exports = {
|
|
173
|
-
plugins: [
|
|
174
|
-
classicPlugin,
|
|
175
|
-
],
|
|
184
|
+
plugins: [classicPlugin],
|
|
176
185
|
};
|
|
177
|
-
|
|
178
186
|
```
|
|
179
187
|
|
|
188
|
+
## Injectables rule scans everything
|
|
180
189
|
|
|
181
190
|
Note: the injectables test scans your whole project. It's best to filter out ts things that don't matter - use `filterFromPaths` configuration setting for this. See the rule documentation for more info.
|
|
182
191
|
|
|
@@ -186,11 +195,14 @@ Note: You can easily turn off all the swagger rules if you don't use swagger by
|
|
|
186
195
|
|
|
187
196
|
```ts
|
|
188
197
|
// all the other config
|
|
189
|
-
extends: [
|
|
190
|
-
|
|
198
|
+
extends: [
|
|
199
|
+
"plugin:@darraghor/nestjs-typed/recommended",
|
|
200
|
+
"plugin:@darraghor/nestjs-typed/no-swagger"
|
|
191
201
|
],
|
|
192
202
|
// more config
|
|
193
|
-
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Disabling a rule
|
|
194
206
|
|
|
195
207
|
Disable a single rule with the full name e.g. in your eslint configuration...
|
|
196
208
|
|