Don't break build on unused import (#1046)
* Fix lint warnings * Let vercel build when unused import
This commit is contained in:
		
							parent
							
								
									7a6725ee77
								
							
						
					
					
						commit
						c044460a91
					
				|  | @ -26,7 +26,7 @@ module.exports = { | |||
|             caughtErrorsIgnorePattern: '^_', | ||||
|           }, | ||||
|         ], | ||||
|         'unused-imports/no-unused-imports': 'error', | ||||
|         'unused-imports/no-unused-imports': 'warn', | ||||
|       }, | ||||
|     }, | ||||
|   ], | ||||
|  |  | |||
|  | @ -26,7 +26,7 @@ module.exports = { | |||
|             caughtErrorsIgnorePattern: '^_', | ||||
|           }, | ||||
|         ], | ||||
|         'unused-imports/no-unused-imports': 'error', | ||||
|         'unused-imports/no-unused-imports': 'warn', | ||||
|       }, | ||||
|     }, | ||||
|   ], | ||||
|  |  | |||
|  | @ -22,8 +22,9 @@ module.exports = { | |||
|     '@next/next/no-typos': 'off', | ||||
|     'linebreak-style': ['error', 'unix'], | ||||
|     'lodash/import-scope': [2, 'member'], | ||||
|     'unused-imports/no-unused-imports': 'error', | ||||
|     'unused-imports/no-unused-imports': 'warn', | ||||
|   }, | ||||
|   ignorePatterns: ['/public/mtg/*'], | ||||
|   env: { | ||||
|     browser: true, | ||||
|     node: true, | ||||
|  |  | |||
|  | @ -114,6 +114,7 @@ export const usePersistentState = <T>( | |||
|     if (key != null && store != null) { | ||||
|       store.set(key, state) | ||||
|     } | ||||
|     // eslint-disable-next-line react-hooks/exhaustive-deps
 | ||||
|   }, [key, state]) | ||||
| 
 | ||||
|   if (store?.readsUrl) { | ||||
|  | @ -127,6 +128,7 @@ export const usePersistentState = <T>( | |||
|         const savedValue = key != null ? store.get(key) : undefined | ||||
|         setState(savedValue ?? initial) | ||||
|       } | ||||
|       // eslint-disable-next-line react-hooks/exhaustive-deps
 | ||||
|     }, [router.isReady]) | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| /* eslint-disable react-hooks/rules-of-hooks */ | ||||
| import { isEmpty } from 'lodash' | ||||
| import { useRouter } from 'next/router' | ||||
| import { useState, useEffect } from 'react' | ||||
|  | @ -12,7 +13,7 @@ type PropzProps = { | |||
| // This allows us to client-side render the page for authenticated users.
 | ||||
| // TODO: Could cache the result using stale-while-revalidate: https://swr.vercel.app/
 | ||||
| export function usePropz( | ||||
|   initialProps: Object, | ||||
|   initialProps: Record<string, unknown>, | ||||
|   getStaticPropz: (props: PropzProps) => Promise<any> | ||||
| ) { | ||||
|   // If props were successfully server-side generated, just use those
 | ||||
|  | @ -29,6 +30,7 @@ export function usePropz( | |||
|     if (router.isReady) { | ||||
|       getStaticPropz({ params }).then((result) => setPropz(result.props)) | ||||
|     } | ||||
|     // eslint-disable-next-line react-hooks/exhaustive-deps
 | ||||
|   }, [params]) | ||||
|   return propz | ||||
| } | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||||
| const defaultTheme = require('tailwindcss/defaultTheme') | ||||
| const plugin = require('tailwindcss/plugin') | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user