Skip to content

Commit

Permalink
[Fix] no-find-dom-node: Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 authored and ljharb committed Aug 4, 2020
1 parent 5a00096 commit 9abc71d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-find-dom-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
}
};
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/rules/no-find-dom-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: `
Expand All @@ -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: `
Expand All @@ -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: `
Expand All @@ -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'
}]
}]
});

0 comments on commit 9abc71d

Please sign in to comment.