You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	* installed eslint-plugin-react-hooks and set up rules of hooks * fixed linter error * changed react-hooks/exhaustive-deps option to error * changed spaces to tabs in eslint config
This commit is contained in:
		| @@ -53,6 +53,11 @@ module.exports = { | ||||
| 		// possible race conditions in contexts where we know it cannot happen. | ||||
| 		"require-atomic-updates": 0, | ||||
|  | ||||
| 		// Checks rules of Hooks | ||||
| 		"react-hooks/rules-of-hooks": "error", | ||||
| 		// Checks effect dependencies | ||||
| 		"react-hooks/exhaustive-deps": "error", | ||||
|  | ||||
| 		// ------------------------------- | ||||
| 		// Formatting | ||||
| 		// ------------------------------- | ||||
| @@ -90,5 +95,6 @@ module.exports = { | ||||
| 	"plugins": [ | ||||
| 		"react", | ||||
| 		"@typescript-eslint", | ||||
| 		"react-hooks" | ||||
| 	], | ||||
| }; | ||||
|   | ||||
| @@ -34,7 +34,7 @@ export default function NoteContentPropertiesDialog(props:NoteContentPropertiesD | ||||
| 			setCharactersNoSpace(counter.characters); | ||||
| 		}); | ||||
| 		setLines(props.text.split('\n').length); | ||||
| 	}, []); | ||||
| 	}, [props.text]); | ||||
|  | ||||
| 	const textProperties: TextPropertiesMap = { | ||||
| 		lines: lines, | ||||
|   | ||||
							
								
								
									
										6
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -1695,6 +1695,12 @@ | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "eslint-plugin-react-hooks": { | ||||
|       "version": "2.4.0", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.4.0.tgz", | ||||
|       "integrity": "sha512-bH5DOCP6WpuOqNaux2BlaDCrSgv8s5BitP90bTgtZ1ZsRn2bdIfeMDY5F2RnJVnyKDy6KRQRDbipPLZ1y77QtQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "eslint-scope": { | ||||
|       "version": "5.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", | ||||
|   | ||||
| @@ -32,6 +32,7 @@ | ||||
|     "@typescript-eslint/parser": "^2.10.0", | ||||
|     "eslint": "^6.1.0", | ||||
|     "eslint-plugin-react": "^7.18.0", | ||||
|     "eslint-plugin-react-hooks": "^2.4.0", | ||||
|     "fs-extra": "^8.1.0", | ||||
|     "glob": "^7.1.6", | ||||
|     "gulp": "^4.0.2", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user