File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,34 @@ doing:
59
59
This is included in all configs shared by this plugin, so can be omitted if
60
60
extending them.
61
61
62
+ ### Running rules only on test-related files
63
+
64
+ The rules provided by this plugin assume that the files they are checking are
65
+ test-related. This means it's generally not suitable to include them in your
66
+ top-level configuration as that applies to all files being linted which can
67
+ include source files.
68
+
69
+ You can use
70
+ [ overrides] ( https://eslint.org/docs/user-guide/configuring/configuration-files#how-do-overrides-work )
71
+ to have ESLint apply additional rules to specific files:
72
+
73
+ ``` json
74
+ {
75
+ "extends" : [" eslint:recommended" ],
76
+ "overrides" : [
77
+ {
78
+ "files" : [" test/**" ],
79
+ "plugins" : [" jest" ],
80
+ "extends" : [" plugin:jest/recommended" ],
81
+ "rules" : { "jest/prefer-expect-assertions" : " off" }
82
+ }
83
+ ],
84
+ "rules" : {
85
+ "indent" : [" error" , 2 ]
86
+ }
87
+ }
88
+ ```
89
+
62
90
### Jest ` version ` setting
63
91
64
92
The behaviour of some rules (specifically [ ` no-deprecated-functions ` ] [ ] ) change
You can’t perform that action at this time.
0 commit comments