Skip to content

Commit 9abc71d

Browse files
ecraig12345ljharb
authored andcommitted
[Fix] no-find-dom-node: Improve error message
1 parent 5a00096 commit 9abc71d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/rules/no-find-dom-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040

4141
context.report({
4242
node: callee,
43-
message: 'Do not use findDOMNode'
43+
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'
4444
});
4545
}
4646
};

tests/lib/rules/no-find-dom-node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ruleTester.run('no-find-dom-node', rule, {
7676
});
7777
`,
7878
errors: [{
79-
message: 'Do not use findDOMNode'
79+
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'
8080
}]
8181
}, {
8282
code: `
@@ -90,7 +90,7 @@ ruleTester.run('no-find-dom-node', rule, {
9090
});
9191
`,
9292
errors: [{
93-
message: 'Do not use findDOMNode'
93+
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'
9494
}]
9595
}, {
9696
code: `
@@ -104,7 +104,7 @@ ruleTester.run('no-find-dom-node', rule, {
104104
};
105105
`,
106106
errors: [{
107-
message: 'Do not use findDOMNode'
107+
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'
108108
}]
109109
}, {
110110
code: `
@@ -118,7 +118,7 @@ ruleTester.run('no-find-dom-node', rule, {
118118
};
119119
`,
120120
errors: [{
121-
message: 'Do not use findDOMNode'
121+
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'
122122
}]
123123
}]
124124
});

0 commit comments

Comments
 (0)