chore(eslint): @typescript-eslint/consistent-type-imports#1195
chore(eslint): @typescript-eslint/consistent-type-imports#1195
Conversation
📝 WalkthroughWalkthroughThis pull request implements TypeScript type-only imports across the codebase by converting value imports to type-only imports where types are used solely for annotations. An ESLint rule Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/e2e/hono.spec.ts`:
- Around line 5-6: The import statement formatting is off: add a space before
the closing brace in the type import. Update the import line that references
Mockttp (import type { Mockttp}) so it reads with a space before the brace
(import type { Mockttp }) to satisfy Prettier; ensure the other import
(getLocal) remains unchanged.
- Around line 1-2: The import statement formatting is missing a space before the
closing brace in the type import; update the import line that references the
symbols HttpBindings and ServerType (i.e., the "import type { HttpBindings,
ServerType}" statement) to include a space before the closing brace so it reads
with proper Prettier spacing.
In `@test/e2e/http-proxy-middleware.spec.ts`:
- Around line 5-6: The import type line has a Prettier formatting error due to a
missing space before the closing brace; update the import statement importing
CompletedRequest and Mockttp (the line containing "import type {
CompletedRequest, Mockttp") to include a space before the closing brace so it
reads with "{ CompletedRequest, Mockttp }", ensuring Prettier passes.
In `@test/e2e/path-rewriter.spec.ts`:
- Line 1: The import line for Mockttp has incorrect spacing; update the import
statement that references the Mockttp type (the "Mockttp" symbol) so the braces
are spaced correctly (i.e., ensure there's a space before the closing brace) to
satisfy Prettier formatting for the import in path-rewriter.spec.ts.
In `@test/e2e/plugins.spec.ts`:
- Line 1: The import statement has incorrect spacing in the named type import
for Mockttp causing Prettier failure; update the import in the file so the named
type has a space before the closing brace (change the token sequence from
"Mockttp}" to "Mockttp }") — e.g. fix the import that references Mockttp in the
top of test/e2e/plugins.spec.ts so it reads the standard form with a space
inside the braces.
In `@test/e2e/router.spec.ts`:
- Line 3: The type import for Mockttp is missing a space before the closing
brace; update the import statement that references Mockttp (the line with
"import type { Mockttp") to include the space so it reads with a space before
the "}" (i.e., fix the import of Mockttp), then re-run Prettier/formatting to
ensure CI passes.
In `@test/e2e/websocket.spec.ts`:
- Around line 5-6: The import statement formatting for the RawData type is
missing a space before the closing brace; update the import of RawData in the
test file (the line importing "RawData" from 'ws' — e.g., the import that
currently reads "import type { RawData} from 'ws';") to include a space before
the brace so it becomes "import type { RawData } from 'ws';" to satisfy
Prettier.
In `@test/unit/fix-request-body.spec.ts`:
- Around line 8-9: Prettier fails due to a missing space before the closing
brace in the type import; update the import statement that references
BodyParserLikeRequest so it reads "import type { BodyParserLikeRequest } from
'../../src/handlers/fix-request-body.js';" (ensure the space before the closing
brace) and verify any other similar imports (e.g., the fixRequestBody import
line) follow the same formatting convention.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 062cf88e-d421-49c0-9718-9a28dac0238e
📒 Files selected for processing (16)
eslint.config.mjssrc/configuration.tssrc/logger.tssrc/plugins/default/debug-proxy-errors-plugin.tssrc/plugins/default/error-response-plugin.tssrc/plugins/default/logger-plugin.tssrc/plugins/default/proxy-events.tstest/e2e/hono.spec.tstest/e2e/http-proxy-middleware.spec.tstest/e2e/path-rewriter.spec.tstest/e2e/plugins.spec.tstest/e2e/router.spec.tstest/e2e/websocket.spec.tstest/unit/configuration.spec.tstest/unit/fix-request-body.spec.tstest/unit/path-filter.spec.ts
5199079 to
e0df3f6
Compare
Summary by CodeRabbit