mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 20:27:55 +00:00 
			
		
		
		
	![gitstart-app[bot]](/assets/img/avatar_default.png) 60598bf235
			
		
	
	60598bf235
	
	
	
		
			
			Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com>
		
			
				
	
	
		
			30 lines
		
	
	
		
			745 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			745 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { TSESLint } from '@typescript-eslint/utils';
 | |
| 
 | |
| import { rule, RULE_NAME } from './useRecoilCallback-has-dependency-array';
 | |
| 
 | |
| const ruleTester = new TSESLint.RuleTester({
 | |
|   parser: require.resolve('@typescript-eslint/parser'),
 | |
| });
 | |
| 
 | |
| ruleTester.run(RULE_NAME, rule, {
 | |
|   valid: [
 | |
|     {
 | |
|       code: 'const someValue = useRecoilCallback(() => () => {}, []);',
 | |
|     },
 | |
|     {
 | |
|       code: 'const someValue = useRecoilCallback(() => () => {}, [dependency]);',
 | |
|     },
 | |
|   ],
 | |
|   invalid: [
 | |
|     {
 | |
|       code: 'const someValue = useRecoilCallback(({}) => () => {});',
 | |
|       errors: [
 | |
|         {
 | |
|           messageId: 'isNecessaryDependencyArray',
 | |
|         },
 | |
|       ],
 | |
|       output: 'const someValue = useRecoilCallback(({}) => () => {}, []);',
 | |
|     },
 | |
|   ],
 | |
| });
 |