fix(librarian/nodejs): run eslint directly for formatting#4592
Merged
julieqiu merged 5 commits intogoogleapis:mainfrom Mar 15, 2026
Merged
fix(librarian/nodejs): run eslint directly for formatting#4592julieqiu merged 5 commits intogoogleapis:mainfrom
julieqiu merged 5 commits intogoogleapis:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Node.js formatting to use eslint directly, which is a good improvement to remove network dependencies and fix globbing issues. The implementation is solid, and the accompanying test is thorough. I have a couple of minor suggestions to improve code style and align with the repository's Go guidelines, mainly around error handling patterns in both the implementation and the test code.
The Format function is updated to run eslint directly instead of npm run fix (gts). The previous approach of running npm run fix failed because gts expands file globs (like src/**/*.ts) at the shell level. This caused it to pick up and attempt to lint files within the node_modules directory, leading to performance issues and formatting failures. Running eslint directly with explicit --ignore-pattern node_modules/ ensures that only the generated source files are processed. Additionally, this switch allows us to use a pre-installed global eslint, avoiding runtime network dependencies and the need for a local npm install during code generation. We use eslint@8 to maintain compatibility with the legacy .eslintrc.json format still used across existing libraries. Fixes #116
7eee56d to
39c2b84
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4592 +/- ##
==========================================
- Coverage 79.39% 79.27% -0.13%
==========================================
Files 110 110
Lines 9223 9235 +12
==========================================
- Hits 7323 7321 -2
- Misses 1389 1403 +14
Partials 511 511 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gapic-generator-typescript takes over 4 minutes to install. Increased timeout to 6 minutes until performance is improved.
Updated TODO comment with a link to the issue for gapic-generator-typescript installation time.
JoeWang1127
approved these changes
Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Format is updated to run eslint directly instead of npm run fix (gts).
The previous approach of running
npm run fixfailed because gts expands file globs (like src/**/*.ts) at the shell level. This caused it to pick up and attempt to lint files within the node_modules directory, leading to formatting failures. Running eslint directly with explicit--ignore-pattern node_modules/ensures that only the generated source files are processed.Additionally, this switch allows us to use a pre-installed global eslint, avoiding runtime network dependencies and the need for a local npm install during code generation. We use eslint@8 to maintain compatibility with the legacy .eslintrc.json format still used across existing libraries. See #4590 for additional context.
For #4404