File tree 6 files changed +1
-128
lines changed
6 files changed +1
-128
lines changed Original file line number Diff line number Diff line change @@ -275,35 +275,6 @@ While the `recommended` and `style` configurations only change in major versions
275
275
the ` all ` configuration may change in any release and is thus unsuited for
276
276
installations requiring long-term consistency.
277
277
278
- ## Snapshot processing
279
-
280
- > [ !NOTE]
281
- >
282
- > This is only relevant for ` eslint.config.js `
283
-
284
- This plugin provides a
285
- [ custom processor] ( https://eslint.org/docs/latest/extend/custom-processors ) to
286
- allow rules to "lint" snapshot files.
287
-
288
- For ` .eslintrc ` based configs, this is automatically enabled out of the box but
289
- must be opted into for ` eslint.config.js ` using the ` flat/snapshots ` config:
290
-
291
- ``` js
292
- const jest = require (' eslint-plugin-jest' );
293
-
294
- module .exports = [
295
- {
296
- ... jest .configs [' flat/snapshots' ],
297
- rules: {
298
- ' jest/no-large-snapshots' : [' error' , { maxSize: 1 }],
299
- },
300
- },
301
- ];
302
- ```
303
-
304
- Unlike other configs, this includes a ` files ` array that matches ` .snap ` files
305
- meaning you can use it directly
306
-
307
278
## Rules
308
279
309
280
<!-- begin auto-generated rules list -->
Original file line number Diff line number Diff line change @@ -193,20 +193,6 @@ exports[`rules should export configs that refer to actual rules 1`] = `
193
193
" jest/valid-title" : " error" ,
194
194
} ,
195
195
},
196
- "flat/snapshots": {
197
- " files" : [
198
- " **/*.snap" ,
199
- ],
200
- " plugins" : {
201
- " jest" : ObjectContaining {
202
- " meta" : {
203
- " name" : " eslint-plugin-jest" ,
204
- " version" : Any <String >,
205
- },
206
- },
207
- },
208
- "processor": "jest/snapshots",
209
- },
210
196
"flat/style": {
211
197
" languageOptions" : {
212
198
" globals" : {
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ describe('rules', () => {
61
61
'flat/recommended' : { plugins : { jest : expectJestPlugin } } ,
62
62
'flat/style' : { plugins : { jest : expectJestPlugin } } ,
63
63
'flat/all' : { plugins : { jest : expectJestPlugin } } ,
64
- 'flat/snapshots' : { plugins : { jest : expectJestPlugin } } ,
65
64
} ) ;
66
65
expect ( Object . keys ( recommendedConfigs ) ) . toEqual ( [
67
66
'all' ,
@@ -70,7 +69,6 @@ describe('rules', () => {
70
69
'flat/all' ,
71
70
'flat/recommended' ,
72
71
'flat/style' ,
73
- 'flat/snapshots' ,
74
72
] ) ;
75
73
expect ( Object . keys ( recommendedConfigs . all . rules ) ) . toHaveLength (
76
74
ruleNames . length - deprecatedRules . length ,
Original file line number Diff line number Diff line change 6
6
version as packageVersion ,
7
7
} from '../package.json' ;
8
8
import globals from './globals.json' ;
9
- import * as snapshotProcessor from './processors/snapshot-processor' ;
10
9
11
10
type RuleModule = TSESLint . RuleModule < string , unknown [ ] > & {
12
11
meta : Required < Pick < TSESLint . RuleMetaData < string > , 'docs' > > ;
@@ -76,19 +75,14 @@ const plugin = {
76
75
| 'style'
77
76
| 'flat/all'
78
77
| 'flat/recommended'
79
- | 'flat/style'
80
- | 'flat/snapshots' ,
78
+ | 'flat/style' ,
81
79
Pick < Required < TSESLint . Linter . Config > , 'rules' >
82
80
> ,
83
81
environments : {
84
82
globals : {
85
83
globals,
86
84
} ,
87
85
} ,
88
- processors : {
89
- snapshots : snapshotProcessor ,
90
- '.snap' : snapshotProcessor ,
91
- } ,
92
86
rules,
93
87
} ;
94
88
@@ -113,12 +107,6 @@ plugin.configs = {
113
107
'flat/all' : createFlatConfig ( allRules ) ,
114
108
'flat/recommended' : createFlatConfig ( recommendedRules ) ,
115
109
'flat/style' : createFlatConfig ( styleRules ) ,
116
- 'flat/snapshots' : {
117
- // @ts -expect-error this is introduced in flat config
118
- files : [ '**/*.snap' ] ,
119
- plugins : { jest : plugin } ,
120
- processor : 'jest/snapshots' ,
121
- } ,
122
110
} ;
123
111
124
112
export = plugin ;
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments