Unverified Commit a1a7a3d3 authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #2277 from hypothesis/update-eslint

Upgrade to ESLint v7.x
parents 5d0b1028 ea93953e
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
"enzyme-adapter-preact-pure": "^2.0.0", "enzyme-adapter-preact-pure": "^2.0.0",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
"eslint": "^6.0.1", "eslint": "^7.3.1",
"eslint-config-hypothesis": "^2.0.0", "eslint-config-hypothesis": "^2.4.0",
"eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-mocha": "^7.0.1", "eslint-plugin-mocha": "^7.0.1",
"eslint-plugin-react": "^7.12.4", "eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^3.0.0", "eslint-plugin-react-hooks": "^4.0.4",
"exorcist": "^1.0.1", "exorcist": "^1.0.1",
"express": "^4.14.1", "express": "^4.14.1",
"fancy-log": "^1.3.3", "fancy-log": "^1.3.3",
......
// eslint-disable-next-line
'use strict'; 'use strict';
module.exports = { module.exports = {
......
import classnames from 'classnames'; import classnames from 'classnames';
import debounce from 'lodash.debounce';
import { createElement } from 'preact'; import { createElement } from 'preact';
import { useCallback } from 'preact/hooks'; import { useCallback, useMemo } from 'preact/hooks';
import debounce from 'lodash.debounce';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { closest } from '../../shared/dom-element'; import { closest } from '../../shared/dom-element';
import useStore from '../store/use-store'; import useStore from '../store/use-store';
...@@ -18,12 +18,12 @@ function ThreadCard({ frameSync, settings = {}, thread }) { ...@@ -18,12 +18,12 @@ function ThreadCard({ frameSync, settings = {}, thread }) {
const threadTag = thread.annotation && thread.annotation.$tag; const threadTag = thread.annotation && thread.annotation.$tag;
const isFocused = useStore(store => store.isAnnotationFocused(threadTag)); const isFocused = useStore(store => store.isAnnotationFocused(threadTag));
const showDocumentInfo = useStore(store => store.route() !== 'sidebar'); const showDocumentInfo = useStore(store => store.route() !== 'sidebar');
const focusThreadAnnotation = useMemo(
const focusThreadAnnotation = useCallback( () =>
debounce(tag => { debounce(tag => {
const focusTags = tag ? [tag] : []; const focusTags = tag ? [tag] : [];
frameSync.focusAnnotations(focusTags); frameSync.focusAnnotations(focusTags);
}, 10), }, 10),
[frameSync] [frameSync]
); );
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment