dillon1000/react

Commit

Add ReactFeatureFlags support to eprh (#35951)

We're currently hardcoding experimental options to
`eslint-plugin-react-hooks`. This blocks the release on features that
might not be ready.

This PR extends the ReactFeatureFlag infra to support flags for
`eslint-plugin-react-hooks`. An alternative would be to create a
separate flag system for build tools, but for now we have a small number
of these and reusing existing infra seems like the simplest approach.

I ran a full `yarn build` and checked the output resolved the flag
values as expected:


_build/oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js_
```js
var eprh_enableUseKeyedStateCompilerLint = false;
var eprh_enableVerboseNoSetStateInEffectCompilerLint = false;
var eprh_enableExhaustiveEffectDependenciesCompilerLint = 'off';
```


_build/facebook-www/ESLintPluginReactHooks-dev.classic.js_

```js
var eprh_enableUseKeyedStateCompilerLint = true;
var eprh_enableVerboseNoSetStateInEffectCompilerLint = true;
var eprh_enableExhaustiveEffectDependenciesCompilerLint = 'extra-only';
```

---------

Co-authored-by: lauren <[email protected]>
Browse files
Changed paths15 files
First-parent comparison
M .github/workflows/runtime_commit_artifacts.yml ModifiedA packages/eslint-plugin-react-hooks/src/shared/ReactFeatureFlags.d.ts AddedM packages/eslint-plugin-react-hooks/src/shared/RunReactCompiler.ts ModifiedM packages/eslint-plugin-react-hooks/tsconfig.json ModifiedM packages/shared/ReactFeatureFlags.js ModifiedM packages/shared/forks/ReactFeatureFlags.native-fb.js ModifiedM packages/shared/forks/ReactFeatureFlags.native-oss.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.www.js ModifiedM packages/shared/forks/ReactFeatureFlags.www.js ModifiedM scripts/flags/flags.js ModifiedM scripts/rollup/build.js ModifiedM scripts/rollup/bundles.js ModifiedM scripts/rollup/validate/index.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…