diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js index 5b8ff6f3e1de4..b6b0c8d4a9674 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js @@ -915,7 +915,8 @@ function functionError(hook, fn) { message: `React Hook "${hook}" is called in function "${fn}" that is neither ` + 'a React function component nor a custom React Hook function.' + - ' React component names must start with an uppercase letter.', + ' React component names must start with an uppercase letter.' + + ' React Hook names must start with the word "use".', }; } diff --git a/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js b/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js index bc747e0094f07..66e2d8edba56f 100644 --- a/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js +++ b/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js @@ -482,7 +482,8 @@ export default { `function "${context.getSource(codePathFunctionName)}" ` + 'that is neither a React function component nor a custom ' + 'React Hook function.' + - ' React component names must start with an uppercase letter.'; + ' React component names must start with an uppercase letter.' + + ' React Hook names must start with the word "use".'; context.report({node: hook, message}); } else if (codePathNode.type === 'Program') { // These are dangerous if you have inline requires enabled.