From 9abc71dc52557f8807eca7c14557914ce93f2d67 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Tue, 4 Aug 2020 12:32:13 -0700 Subject: [PATCH] [Fix] `no-find-dom-node`: Improve error message --- lib/rules/no-find-dom-node.js | 2 +- tests/lib/rules/no-find-dom-node.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rules/no-find-dom-node.js b/lib/rules/no-find-dom-node.js index ae3c5e3d6a..eb2664fc0a 100644 --- a/lib/rules/no-find-dom-node.js +++ b/lib/rules/no-find-dom-node.js @@ -40,7 +40,7 @@ module.exports = { context.report({ node: callee, - message: 'Do not use findDOMNode' + message: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode' }); } }; diff --git a/tests/lib/rules/no-find-dom-node.js b/tests/lib/rules/no-find-dom-node.js index a0d915d228..76d3f23bbe 100644 --- a/tests/lib/rules/no-find-dom-node.js +++ b/tests/lib/rules/no-find-dom-node.js @@ -76,7 +76,7 @@ ruleTester.run('no-find-dom-node', rule, { }); `, errors: [{ - message: 'Do not use findDOMNode' + message: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode' }] }, { code: ` @@ -90,7 +90,7 @@ ruleTester.run('no-find-dom-node', rule, { }); `, errors: [{ - message: 'Do not use findDOMNode' + message: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode' }] }, { code: ` @@ -104,7 +104,7 @@ ruleTester.run('no-find-dom-node', rule, { }; `, errors: [{ - message: 'Do not use findDOMNode' + message: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode' }] }, { code: ` @@ -118,7 +118,7 @@ ruleTester.run('no-find-dom-node', rule, { }; `, errors: [{ - message: 'Do not use findDOMNode' + message: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode' }] }] });