GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add additional messaging for RulesOfHooks lint error (#20692) · react/react@c62986c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/eslint-plugin-react-hooks
    • __tests__
      • ESLintRulesOfHooks-test.js
    • src
      • RulesOfHooks.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,8 @@ function functionError(hook, fn) {
915915
message:
916916
`React Hook "${hook}" is called in function "${fn}" that is neither ` +
917917
'a React function component nor a custom React Hook function.' +
918-
' React component names must start with an uppercase letter.',
918+
' React component names must start with an uppercase letter.' +
919+
' React Hook names must start with the word "use".',
919920
};
920921
}
921922

Collapse file

‎packages/eslint-plugin-react-hooks/src/RulesOfHooks.js‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ export default {
482482
`function "${context.getSource(codePathFunctionName)}" ` +
483483
'that is neither a React function component nor a custom ' +
484484
'React Hook function.' +
485-
' React component names must start with an uppercase letter.';
485+
' React component names must start with an uppercase letter.' +
486+
' React Hook names must start with the word "use".';
486487
context.report({node: hook, message});
487488
} else if (codePathNode.type === 'Program') {
488489
// These are dangerous if you have inline requires enabled.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.