Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: eslint-plugin-react-hooks doesnt handle components starting with non-ASCII uppercase letter #32775

Open
blommish opened this issue Mar 28, 2025 · 2 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@blommish
Copy link

React version: 18.3.1
eslint-plugin-react-hooks: 5.2.0 (5.0.0+)

Steps To Reproduce

  1. Create a component starting with non-ASCII character, ÅÆØÄÖ

Link to code example:

export const ÅComponent = () => {
    const {foo} = useMyHook()
};
export const ÅComponent = () => {
    const {foo} = useMyHook()
};

The current behavior

React Hook "useMyHook" is called in function "..." that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"

The expected behavior

@blommish blommish added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Mar 28, 2025
blommish added a commit to navikt/tilleggsstonader-sak-frontend that referenced this issue Mar 28, 2025
- Endrer navn på komponent pga bug i regel facebook/react#32775
@sergiotales1
Copy link

sergiotales1 commented Apr 2, 2025

Hello!
Even though non-ASCII characters are allowed to be used to name components, i believe that it leads to inconsistency and it would make it difficult to other co-workers from different countries to contribute with you code, in addition to not being fully compatible in older systems or tools, eslint is a good example of this... Do you have a reason for using these sort of characters into your component functions ?

@blommish
Copy link
Author

blommish commented Apr 3, 2025

Hello! Even though non-ASCII characters are allowed to be used to name components, i believe that it leads to inconsistency and it would make it difficult to other co-workers from different countries to contribute with you code, in addition to not being fully compatible in older systems or tools, eslint is a good example of this... Do you have a reason for using these sort of characters into your component functions ?

In my project we use local domain language for components, not being forced to try to translate some difficult words.
Some of those words starts with an nordic characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants