HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jsx-eslint
eslint-plugin-react
JavaScript2015–2024
jsx-eslint / eslint-plugin-react

eslint-plugin-react

React-specific linting rules for ESLint

16Distinct people
16Mentions
1Explicit recommenders
9.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

React-specific linting rules for ESLint

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

One of my favorite eslint rules to enable: https://github.com/jsx-eslint/eslint-plugin-react/blob/maste...

ervine used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year16 dated mentions

Observed mentions: 2015-06-08 22:27:49 UTC to 2024-10-29 00:14:45 UTC.

012342015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC211
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

What Hacker News says

16 sources
The weird hostile attitude ESLint has about using global config really bums me out. Not everyone wants to install ESLint in every package.json. I work in more than 30 active repos. I want global eslint to just work for most of them, and specific ESLint to work for a few. This used to work fine, now it doesn't. https://eslint.org/docs/latest/use/getting-started > It is also possible to install ESLint globally, rather than locally, using npm install eslint --global. However, this is not recommended, and any plugins or shareable configs that you use must still be installed locally if you install ESLint globally. Which means that simple stuff like just adding the airbnb or eslint recommended settings can now only be done locally. More discussion here: https://github.com/eslint/eslint/issues/11914 And here: https://github.com/jsx-eslint/eslint
Read the rest
-plugin-react/issues/233... Not everyone works on giant teams where global settings that aren't part of the project become a nightmare for compatibility. We have a very small team with often just one developer doing most of the work on a project.
In What's Coming Next for ESLint
> [1] https://github.com/jsx-eslint/eslint-plugin-react/blob/maste... From what I remember, being able to pass children as a prop is considered a side-effect of an implementation detail, that breaks the expected abstraction. There really isn't any reason to use it, and I think there's a chance it may even limit what the virtual dom diffing can manage? Also this would prevent you from accidentally doing both at once: <MyComponent children={<div>Is it me?</div>}> <div>Or is it me?</div> </MyComponent> (I don't remember what React does in this situation)
In Interesting Bugs Caught by ESLint's no-constant-binary-expression (2022)
This is pretty compelling. Why isn't it in the "recommended" preset of lints? In general, I find it frustrating that the eslint recommended presets don't document why they are recommended. I disable several of the rules in all my projects because they seem to be arbitrary stylistic choices (e.g. [0], [1], [2]). [0] https://typescript-eslint.io/rules/no-empty-function/ [1] https://github.com/jsx-eslint/eslint-plugin-react/blob/maste... [2] Specifically checkLoops of https://eslint.org/docs/latest/rules/no-constant-condition [edit] In looking up no-empty-function, I saw a stack overflow post that provides a compelling alternative of using `() => undefined` instead of `() => {}`, which suppresses the error. That should be shown as an example on the eslint page!
In Interesting Bugs Caught by ESLint's no-constant-binary-expression (2022)
I try to focus on the issues rather than individuals, but the root of the problems in the listed eslint plugin libraries points to ljharb. If you do some simple digging into these libraries, you will find that these types of commits are quite common within them. https://github.com/jsx-eslint/eslint-plugin-react/commit/e1d... https://github.com/jsx-eslint/jsx-ast-utils/commit/bad51d062... https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/... He would rather see the download count of these polyfill libraries https://github.com/ljharb/ljharb#projects-i-maintain increase, compared to assessing the health of the JavaScript ecosystem.
In Speeding up the JavaScript ecosystem – Polyfills gone rogue
For what it's worth; `eslint-plugin-react` has been around for a long time and seems to support running in very old versions of Node.JS (back to v4[1] apparently! tho I can't find anything documenting that for sure.) I was surprised to learn that Object.values is only supported in Node >v7, Object.fronEntries was added in v12, etc. So for this project maybe the polyfills are needed. [1] https://github.com/jsx-eslint/eslint-plugin-react/pull/1038
In Speeding up the JavaScript ecosystem – Polyfills gone rogue
Thanks for weighing in, that's good to know. After wondering if this could be auto-refactored, I came across https://github.com/jsx-eslint/eslint-plugin-react/blob/maste..., will definitely have to give that (with `--fix`) a try in the new year and see if I can get the team on board! – desire for typescript being a compelling factor. Personally I do like the non-destructured `props.abc` throughout component code, really helps clarify at a glance where something is coming from, whether it's locally or externally defined, etc. Code style is an endless exercise in compromises/opinions though, even _with_ tools like eslint and prettier.
In Ask HN: What are your predictions for 2023?

Show HN: Publish from GitHub Actions using multi-factor authentication

The backstory about this GitHub Action: I discussed with an open-source maintainer why they publish npm packages from their local machine and do not use CI/CD pipelines. They said publishing should require human intervention and want to continue using multi-factor authentication to publish to the npm registry. This led to building the wait-for-secrets GitHub Action. It prints a URL in the build log and waits for secrets to be entered using a browser. Once entered, the workflow continues, and secrets can be used in future steps. The latest release of "eslint-plugin-react" to the npm registry used a one-time password (OTP) from a GitHub Actions workflow! https://github.com/jsx-eslint/eslint-plugin-react/actions/ru...
72 points · Open discussion
Thanks for the reply and the details. Let me see if I can add more context to the overall discussion, and why Ryan wrote the article in the first place. First, the author of the article is Ryan Florence. He's a very well-known name in the React community, as he's co-author of React-Router, and co-owner of the React Training company. He makes a living teaching React to developers at different companies. I don't always agree with _everything_ he says, but he has a _lot_ of personal experience using React, and has seen a wide variety of ways that people are learning and using React in the real world. So, I don't think it's fair to say that he's "generalising his own limited experience". Second, I would say that Ryan's post isn't trying to argue that you should never-ever worry about creating functions in `render()`. It _is_ trying to s
Read the rest
ay that that has become a blanket concern that people blindly repeat, no matter what the actual performance concerns are for a given component, and that some of the possible origins for that concern are likely no longer an issue with modern JS engines. For example, I know that AirBnB's ESLint config, which is very popular, turns on the "react/jsx-no-bind" rule [0] by default. This rule flat-out forbids using `fn.bind()` inside of JSX constructs, but does not take into account anything like how the component is actually being used. A component rendered once at the top level of an app is going to have a vastly different performance profile than a nested component in the middle of a hot UI code path. I've seen learners who are still trying to grasp the basics of React being told "oh, you should never use an arrow function in `render()`, that's slow". Even if that's true, that's also not the advice the learner needs at that time. The most common example of this I see is someone who wants to pass a parameter to a callback, and they do: onClick={this.handleClick("stuff")} That of course fails, because the click handler is being called immediately during rendering. The simplest fix for this is to just make it an arrow function that closes over the call: onClick={() => this.handleClick("stuff")} Even if that isn't the most absolutely performant approach, it _works_, it's simple for the learner to implement, and it solves their immediate problem. They don't _need_ to be worrying about perf at that level of understanding. Now, as you said: _if_ you do have an extremely hot and perf-sensitive UI path, then yes, it's worth worrying about the details like this. But, the point of the article is that the React community has gotten in the habit of blindly repeating "DON'T DO THAT EVER!!!!!", when the reality is much more nuanced: "Don't worry about that.... _yet_". To specifically answer your last aspect: Let's say you've got a child component that implements a click handler like this: handleClick = () => { this.props.doStuff(this.props.id, this.state.someValue); } In that example, `this.props.doStuff` isn't actually affecting rendering. So, if the parent component passes in a new function reference for `props.doStuff`, the component doesn't actually need to re-render - the click handler would behave the same way regardless. [0] https://github.com/yannickcr/eslint-plugin-react/blob/master...
In React, Inline Functions, and Performance
The decision to use JSX or not is really one of the least important decisions you need to make when writing a React application. It's essentially a style preference. Personally I like JSX. It's nice having a special syntax that your editor and linter [1] can understand. And if you are part of the stateless/minimal-logic component camp then most of your components will look more like HTML/JSX with a little bit of JS interspersed than vice-versa. [1] https://github.com/yannickcr/eslint-plugin-react#jsx-specifi...
In JSX is no longer my friend

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.