File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,16 @@ export default createRule({
1515 messages : {
1616 deprecatedFunction :
1717 '`{{ deprecation }}` has been deprecated in favor of `{{ replacement }}`' ,
18- jestNotDetected :
19- 'Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly' ,
2018 } ,
2119 type : 'suggestion' ,
2220 schema : [ ] ,
2321 fixable : 'code' ,
2422 } ,
2523 defaultOptions : [ ] ,
2624 create ( context ) {
27- // If jest version is not detected, it is set to Infinity so that all possible deprecations
28- // are reported with a "jest not detected" error message
25+ // If jest version is not detected, assume latest
2926 const jestVersion =
3027 getJestVersion ( context as EslintPluginJestRuleContext ) || Infinity ;
31- const jestNotDetected = jestVersion === Infinity ;
3228
3329 const deprecations : Record < string , string > = {
3430 ...( jestVersion >= 15 && {
@@ -65,16 +61,13 @@ export default createRule({
6561 const { callee } = node ;
6662
6763 context . report ( {
68- messageId : jestNotDetected ? 'jestNotDetected' : 'deprecatedFunction' ,
64+ messageId : 'deprecatedFunction' ,
6965 data : {
7066 deprecation,
7167 replacement,
7268 } ,
7369 node,
7470 fix ( fixer ) {
75- if ( jestNotDetected ) {
76- return [ ] ;
77- }
7871 let [ name , func ] = replacement . split ( '.' ) ;
7972
8073 if ( callee . property . type === AST_NODE_TYPES . Literal ) {
You can’t perform that action at this time.
0 commit comments