style: fix linting issues met ESLint
This commit is contained in:
		
							parent
							
								
									9dcc1091cc
								
							
						
					
					
						commit
						ef5c51b463
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		|  | @ -5,7 +5,7 @@ | ||||||
|  */ |  */ | ||||||
| export const assignmentTitleRules = [ | export const assignmentTitleRules = [ | ||||||
|     (value: string): string | boolean => { |     (value: string): string | boolean => { | ||||||
|         if (value?.length >= 1) return true;  // Title must not be empty
 |         if (value?.length >= 1) {return true;}  // Title must not be empty
 | ||||||
|         return 'Title cannot be empty.'; |         return 'Title cannot be empty.'; | ||||||
|     }, |     }, | ||||||
| ]; | ]; | ||||||
|  | @ -31,7 +31,7 @@ export const learningPathRules = [ | ||||||
|  */ |  */ | ||||||
| export const classRules = [ | export const classRules = [ | ||||||
|     (value: string): string | boolean => { |     (value: string): string | boolean => { | ||||||
|         if (value) return true; |         if (value) {return true;} | ||||||
|         return 'You must select at least one class.'; |         return 'You must select at least one class.'; | ||||||
|     }, |     }, | ||||||
| ]; | ]; | ||||||
|  | @ -43,14 +43,14 @@ export const classRules = [ | ||||||
|  */ |  */ | ||||||
| export const deadlineRules = [ | export const deadlineRules = [ | ||||||
|     (value: string): string | boolean => { |     (value: string): string | boolean => { | ||||||
|         if (!value) return "You must set a deadline."; |         if (!value) {return "You must set a deadline.";} | ||||||
| 
 | 
 | ||||||
|         const selectedDateTime = new Date(value); |         const selectedDateTime = new Date(value); | ||||||
|         const now = new Date(); |         const now = new Date(); | ||||||
| 
 | 
 | ||||||
|         if (isNaN(selectedDateTime.getTime())) return "Invalid date or time."; |         if (isNaN(selectedDateTime.getTime())) {return "Invalid date or time.";} | ||||||
| 
 | 
 | ||||||
|         if (selectedDateTime <= now) return "The deadline must be in the future."; |         if (selectedDateTime <= now) {return "The deadline must be in the future.";} | ||||||
| 
 | 
 | ||||||
|         return true; |         return true; | ||||||
|     }, |     }, | ||||||
|  | @ -58,7 +58,7 @@ export const deadlineRules = [ | ||||||
| 
 | 
 | ||||||
| export const descriptionRules = [ | export const descriptionRules = [ | ||||||
|     (value: string): string | boolean => { |     (value: string): string | boolean => { | ||||||
|         if (!value || value.trim() === "") return "Description cannot be empty."; |         if (!value || value.trim() === "") {return "Description cannot be empty.";} | ||||||
|         return true; |         return true; | ||||||
|     }, |     }, | ||||||
| ]; | ]; | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action