This repository was archived by the owner on Oct 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import docsUrl from '../utils/docs-url';
2828const message = ( line : string ) =>
2929 `Update this function so that its implementation is not identical to the one on line ${ line } .` ;
3030
31- type Function =
31+ type FunctionNode =
3232 | TSESTree . FunctionDeclaration
3333 | TSESTree . FunctionExpression
3434 | TSESTree . ArrowFunctionExpression ;
@@ -49,7 +49,7 @@ const rule: Rule.RuleModule = {
4949 ] ,
5050 } ,
5151 create ( context : Rule . RuleContext ) {
52- const functions : Array < { function : Function ; parent : TSESTree . Node | undefined } > = [ ] ;
52+ const functions : Array < { function : FunctionNode ; parent : TSESTree . Node | undefined } > = [ ] ;
5353
5454 return {
5555 FunctionDeclaration ( node : TSESTree . Node ) {
@@ -67,17 +67,13 @@ const rule: Rule.RuleModule = {
6767 } ,
6868 } ;
6969
70- function visitFunction ( node : Function ) {
70+ function visitFunction ( node : FunctionNode ) {
7171 if ( isBigEnough ( node . body ) ) {
7272 functions . push ( { function : node , parent : node . parent } ) ;
7373 }
7474 }
7575
7676 function processFunctions ( ) {
77- if ( functions . length < 2 ) {
78- return ;
79- }
80-
8177 for ( let i = 1 ; i < functions . length ; i ++ ) {
8278 const duplicatingFunction = functions [ i ] . function ;
8379
You can’t perform that action at this time.
0 commit comments