Skip to content

Ignore the Gradle plugin's build output in ESLint - #60376

Merged
cortinico merged 1 commit into
react:mainfrom
expo:@ide/gradle-eslint-ignore-plugin-build
Dec 4, 2026
Merged

cortinico merged 1 commit into
react:mainfrom
expo:@ide/gradle-eslint-ignore-plugin-build

Conversation

@ide

@ide ide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

When a module under packages/gradle-plugin runs its tests, Gradle writes an HTML test report with a report.js into the module's build directory. The file has no Flow annotation, so yarn lint fails once the plugin's tests have run:

packages/gradle-plugin/react-native-gradle-plugin/build/reports/tests/test/js/report.js
   1:1   error    Flow file annotation is missing  ft-flow/require-valid-file-annotation

packages/gradle-plugin/.gitignore already ignores build/ at any depth, but ESLint does not read .gitignore. This change adds packages/gradle-plugin/**/build/, which matches the same directories, to .eslintignore, next to the entries for ReactAndroid's build directories.

Changelog:

[INTERNAL] [FIXED] - Stop yarn lint from checking the Gradle plugin's test reports

Test Plan:

After running the plugin's tests (./gradlew -p packages/gradle-plugin :react-native-gradle-plugin:test --tests com.facebook.react.tasks.internal.PreparePrefabHeadersTaskTest), with report.js present:

yarn eslint --max-warnings 0 packages/gradle-plugin
  • On main: an error and two warnings, all in report.js.
  • On this branch: no problems.

Not run: yarn lint over the whole repository.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2026
@ide
ide force-pushed the @ide/gradle-eslint-ignore-plugin-build branch from 6aebee2 to 5f04b69 Compare November 29, 2026 12:02
@ide
ide marked this pull request as ready for review November 29, 2026 13:49
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 29, 2026

@chrfalch chrfalch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can be approved.

One optional nit: packages/gradle-plugin/*/build/ only matches a build/ folder one level down. The plugin's own .gitignore has build/, which ignores build output at any depth, including packages/gradle-plugin/build/. Nothing writes test-report JS there today as far as I can tell, but packages/gradle-plugin/**/build/ would match what git ignores and keep the two from drifting.

@ide
ide force-pushed the @ide/gradle-eslint-ignore-plugin-build branch from 5f04b69 to 0d17300 Compare December 1, 2026 01:24
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Visual regression

No visual differences at 2ea3999f9741.

Gradle writes an HTML test report, with a `report.js`, into the build
directory of a module under `packages/gradle-plugin` when its tests run.
The file has no Flow annotation, so `yarn lint` fails with
`ft-flow/require-valid-file-annotation` once the plugin's tests have
run. Git already ignores these directories; ESLint does not read
`.gitignore`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ide
ide force-pushed the @ide/gradle-eslint-ignore-plugin-build branch from 0d17300 to 2ea3999 Compare December 1, 2026 03:06
@ide

ide commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@chrfalch Changed to packages/gradle-plugin/**/build/, so it matches what the plugin's .gitignore ignores at any depth, including packages/gradle-plugin/build/.

@cortinico
cortinico merged commit 82a3aed into react:main Dec 4, 2026
96 checks passed
@ide
ide deleted the @ide/gradle-eslint-ignore-plugin-build branch December 4, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants