From 67cebf6da60e53933bd5bb456c1ed3c87ab7518f Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 28 Aug 2019 11:56:18 +0800 Subject: [PATCH] :lipstick: fix eslint error --- .eslintrc.js | 2 +- site/theme/template/IconDisplay/IconPicSearcher.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 83fdbbf0ac..46a4bfffb2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,7 @@ const eslintrc = { }, settings: { react: { - version: '16.8', + version: '16.9', }, }, parser: '@typescript-eslint/parser', diff --git a/site/theme/template/IconDisplay/IconPicSearcher.tsx b/site/theme/template/IconDisplay/IconPicSearcher.tsx index 3cba906060..fbb4ba8fcc 100644 --- a/site/theme/template/IconDisplay/IconPicSearcher.tsx +++ b/site/theme/template/IconDisplay/IconPicSearcher.tsx @@ -72,7 +72,7 @@ class PicSearcher extends Component { const img = new Image(); img.setAttribute('crossOrigin', 'anonymous'); img.src = url; - img.onload = function() { + img.onload = function onload() { const scale = Math.min(1, 300 / Math.max(img.width, img.height)); const canvas = document.createElement('canvas'); canvas.width = img.width * scale;