SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[lint] Enable custom hooks configuration for useEffectEvent calling rules (#34497)

We need to be able to specify additional effect hooks for the
RulesOfHooks lint rule
in order to allow useEffectEvent to be called by custom effects.
ExhaustiveDeps
does this with a regex suppplied to the rule, but that regex is not
accessible from
other rules.

This diff introduces a `react-hooks` entry you can put in the eslint
settings that
allows you to specify custom effect hooks and share them across all
rules.

This works like:
```
{
  settings: {
    'react-hooks': {
      additionalEffectHooks: string,
    },
  },
}
```

The next diff allows useEffect to read from the same configuration.

----

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34497).
* #34637
* __->__ #34497

DiffTrain build for [92cfdc3a4ed8f3350b746bd79d87f6549db8003c](https://github.com/facebook/react/commit/92cfdc3a4ed8f3350b746bd79d87f6549db8003c)
J
jbrown215 committed
9f4b4ff51308dbd33473d59d888c1263bfc5705a
Parent: 7b12110