chore(typescript): Enabled noFallthroughCasesInSwitch
Turned on the noFallthroughCasesInSwitch flag in tsconfig and fixed a few cases where there were fallthroughs.
This commit is contained in:
		
							parent
							
								
									f6a410a4a8
								
							
						
					
					
						commit
						8899b83927
					
				| @ -91,7 +91,10 @@ export class UpgradeNg1ComponentAdapterBuilder { | |||||||
|               this.outputs.push(outputName); |               this.outputs.push(outputName); | ||||||
|               this.outputsRename.push(outputNameRenameChange); |               this.outputsRename.push(outputNameRenameChange); | ||||||
|               this.propertyMap[outputName] = localName; |               this.propertyMap[outputName] = localName; | ||||||
|             // don't break; let it fall through to '@'
 |               this.inputs.push(inputName); | ||||||
|  |               this.inputsRename.push(inputNameRename); | ||||||
|  |               this.propertyMap[inputName] = localName; | ||||||
|  |               break; | ||||||
|             case '@': |             case '@': | ||||||
|             // handle the '<' binding of angular 1.5 components
 |             // handle the '<' binding of angular 1.5 components
 | ||||||
|             case '<': |             case '<': | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ | |||||||
|     "moduleResolution": "node", |     "moduleResolution": "node", | ||||||
|     "outDir": "../dist/all/", |     "outDir": "../dist/all/", | ||||||
|     "noImplicitAny": true, |     "noImplicitAny": true, | ||||||
|  |     "noFallthroughCasesInSwitch": true, | ||||||
|     "paths": { |     "paths": { | ||||||
|       "selenium-webdriver": ["../node_modules/@types/selenium-webdriver/index.d.ts"], |       "selenium-webdriver": ["../node_modules/@types/selenium-webdriver/index.d.ts"], | ||||||
|       "rxjs/*": ["../node_modules/rxjs/*"], |       "rxjs/*": ["../node_modules/rxjs/*"], | ||||||
|  | |||||||
| @ -64,9 +64,8 @@ export class MetadataCollector { | |||||||
|         let isConstructor = false; |         let isConstructor = false; | ||||||
|         switch (member.kind) { |         switch (member.kind) { | ||||||
|           case ts.SyntaxKind.Constructor: |           case ts.SyntaxKind.Constructor: | ||||||
|             isConstructor = true; |  | ||||||
|           // fallthrough
 |  | ||||||
|           case ts.SyntaxKind.MethodDeclaration: |           case ts.SyntaxKind.MethodDeclaration: | ||||||
|  |             isConstructor = member.kind === ts.SyntaxKind.Constructor; | ||||||
|             const method = <ts.MethodDeclaration|ts.ConstructorDeclaration>member; |             const method = <ts.MethodDeclaration|ts.ConstructorDeclaration>member; | ||||||
|             const methodDecorators = getDecorators(method.decorators); |             const methodDecorators = getDecorators(method.decorators); | ||||||
|             const parameters = method.parameters; |             const parameters = method.parameters; | ||||||
|  | |||||||
| @ -176,6 +176,8 @@ export class Evaluator { | |||||||
|             case ts.SyntaxKind.BarBarToken: |             case ts.SyntaxKind.BarBarToken: | ||||||
|               return this.isFoldableWorker(binaryExpression.left, folding) && |               return this.isFoldableWorker(binaryExpression.left, folding) && | ||||||
|                   this.isFoldableWorker(binaryExpression.right, folding); |                   this.isFoldableWorker(binaryExpression.right, folding); | ||||||
|  |             default: | ||||||
|  |               return false; | ||||||
|           } |           } | ||||||
|         case ts.SyntaxKind.PropertyAccessExpression: |         case ts.SyntaxKind.PropertyAccessExpression: | ||||||
|           const propertyAccessExpression = <ts.PropertyAccessExpression>node; |           const propertyAccessExpression = <ts.PropertyAccessExpression>node; | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ | |||||||
|     "moduleResolution": "node", |     "moduleResolution": "node", | ||||||
|     "outDir": "../dist/tools/", |     "outDir": "../dist/tools/", | ||||||
|     "noImplicitAny": true, |     "noImplicitAny": true, | ||||||
|  |     "noFallthroughCasesInSwitch": true, | ||||||
|     "paths": { |     "paths": { | ||||||
|     }, |     }, | ||||||
|     "rootDir": ".", |     "rootDir": ".", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user