Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/runtime_commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,11 @@ jobs:
run: |
sed -i -e 's/ @license React*//' \
build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
build/facebook-www/ESLintPluginReactHooks-dev.modern.js \
build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js
- name: Insert @headers into eslint plugin and react-refresh
run: |
sed -i -e 's/ LICENSE file in the root directory of this source tree./ LICENSE file in the root directory of this source tree.\n *\n * @noformat\n * @nolint\n * @lightSyntaxTransform\n * @preventMunge\n * @oncall react_core/' \
build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
build/facebook-www/ESLintPluginReactHooks-dev.modern.js \
build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js
- name: Move relevant files for React in www into compiled
run: |
Expand All @@ -134,9 +132,9 @@ jobs:
mkdir ./compiled/facebook-www/__test_utils__
mv build/__test_utils__/ReactAllWarnings.js ./compiled/facebook-www/__test_utils__/ReactAllWarnings.js

# Copy eslint-plugin-react-hooks (www build with feature flags)
# Copy eslint-plugin-react-hooks
mkdir ./compiled/eslint-plugin-react-hooks
cp ./compiled/facebook-www/ESLintPluginReactHooks-dev.modern.js \
cp build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
./compiled/eslint-plugin-react-hooks/index.js

# Move unstable_server-external-runtime.js into facebook-www
Expand Down
2 changes: 1 addition & 1 deletion scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ const bundles = [
// currently required in order for the package to be copied over correctly.
// So, it would be worth improving that flow.
name: 'eslint-plugin-react-hooks',
bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV, FB_WWW_PROD, CJS_DTS],
bundleTypes: [NODE_DEV, NODE_PROD, CJS_DTS],
moduleType: ISOMORPHIC,
entry: 'eslint-plugin-react-hooks/src/index.ts',
global: 'ESLintPluginReactHooks',
Expand Down
6 changes: 6 additions & 0 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ const forks = Object.freeze({
return './packages/shared/forks/ReactFeatureFlags.test-renderer.www.js';
}
return './packages/shared/forks/ReactFeatureFlags.test-renderer.js';
case 'eslint-plugin-react-hooks/src/index.ts':
// Use www feature flags for the eslint plugin regardless of
// bundleType. The NODE_DEV wrapper ensures process.env.NODE_ENV is
// used instead of __DEV__, avoiding ReferenceErrors in Node.js
// environments (Jest, arc lint) that don't define __DEV__.
return './packages/shared/forks/ReactFeatureFlags.www.js';
default:
switch (bundleType) {
case FB_WWW_DEV:
Expand Down
5 changes: 0 additions & 5 deletions scripts/rollup/validate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ function getFormat(filepath) {
// TODO: Should we lint them?
return null;
}
if (filepath.includes('ESLintPluginReactHooks')) {
// The ESLint plugin bundles compiler code with modern syntax that
// doesn't need to conform to the ES5 www lint rules.
return null;
}
return 'fb';
}
if (filepath.includes('react-native')) {
Expand Down
Loading