From 5943b1da6cb49476ee79dd3c06b10d0bd299bfe0 Mon Sep 17 00:00:00 2001 From: Rane Wallin Date: Thu, 3 Oct 2019 05:44:48 -0700 Subject: [PATCH] Fixing grammatical errors in error message (#16973) * Fixing grammatical errors in error message * Fixing grammar error in test file --- .../__tests__/ESLintRulesOfHooks-test.js | 4 ++-- packages/eslint-plugin-react-hooks/src/RulesOfHooks.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js index c6fc1746e1351..3314439cd35d5 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js @@ -758,8 +758,8 @@ function loopError(hook) { function functionError(hook, fn) { return { message: - `React Hook "${hook}" is called in function "${fn}" which is neither ` + - 'a React function component or a custom React Hook function.', + `React Hook "${hook}" is called in function "${fn}" that is neither ` + + 'a React function component nor a custom React Hook function.', }; } diff --git a/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js b/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js index a4a4063a8b019..73636e60daf16 100644 --- a/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js +++ b/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js @@ -428,7 +428,7 @@ export default { const message = `React Hook "${context.getSource(hook)}" is called in ` + `function "${context.getSource(codePathFunctionName)}" ` + - 'which is neither a React function component or a custom ' + + 'that is neither a React function component nor a custom ' + 'React Hook function.'; context.report({node: hook, message}); } else if (codePathNode.type === 'Program') {