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

jsx-handler-names suboption handling bug #1431

Closed
evan-scott-zocdoc opened this issue Sep 14, 2017 · 5 comments
Closed

jsx-handler-names suboption handling bug #1431

evan-scott-zocdoc opened this issue Sep 14, 2017 · 5 comments

Comments

@evan-scott-zocdoc
Copy link

"react/jsx-handler-names": 2, {
  "eventHandlerPropPrefix": false
}]

I would expect false or '' to disable the eventHandlerPropPrefix rule, but it doesn't.

@jseminck
Copy link
Contributor

Since the code is:

    const eventHandlerPropPrefix = configuration.eventHandlerPropPrefix || 'on';

Using '' or false will actually indeed make it default to 'on'.
Additionally false isn't a valid value because it requires a string.

I assume your use case is that you only want to use the eventHandlerPrefix part of this rule? It does seem like that is currently not supported.

@evan-scott-zocdoc
Copy link
Author

evan-scott-zocdoc commented Sep 14, 2017 via email

@jseminck
Copy link
Contributor

jseminck commented Sep 14, 2017

I guess we can explicitly check for undefined in configuration.eventHandlerPropPrefix === undefined || 'on' so that using '' would disable this part of the configuration.

Let's see what other think about it, otherwise seems like a straight forward change. I can make a PR for that later today.

@ljharb
Copy link
Member

ljharb commented Sep 19, 2017

An empty string shouldn't be valid.

false might be useful, however.

@ljharb
Copy link
Member

ljharb commented Feb 4, 2022

Fixed by #2410; duplicated by #2400.

@ljharb ljharb closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants