Skip to content

feat(parser): add TS1363 error code#17609

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-03-feat_parser_add_ts1363_error_code
Jan 5, 2026
Merged

feat(parser): add TS1363 error code#17609
graphite-app[bot] merged 1 commit intomainfrom
01-03-feat_parser_add_ts1363_error_code

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Jan 3, 2026

TS Playground: https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnAYhCARFAzAQwFcAbGAGjgG84AhAqS+gLzgF848oIQ4AiEBAAmpFHwDcQA

found in tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/input.ts

The span is not correct, but I think this is still better then nothing :)
The span should be only on the specifiers, not on the complete import declaration.

@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Jan 3, 2026
Copy link
Member Author

Sysix commented Jan 3, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 3, 2026

CodSpeed Performance Report

Merging #17609 will not alter performance

Comparing 01-03-feat_parser_add_ts1363_error_code (1c4968b) with 01-03-refactor_parser_pass_sourcetype_to_modulerecordbuilder_ (9394582)

Summary

✅ 42 untouched
⏩ 3 skipped1

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Sysix Sysix force-pushed the 01-03-feat_parser_add_ts1363_error_code branch from 03eb5ef to db237f0 Compare January 3, 2026 17:39
@Sysix Sysix changed the base branch from main to graphite-base/17609 January 3, 2026 18:03
@Sysix Sysix force-pushed the 01-03-feat_parser_add_ts1363_error_code branch from db237f0 to 137fdfc Compare January 3, 2026 18:03
@Sysix Sysix force-pushed the graphite-base/17609 branch from 3a0c782 to db8c69a Compare January 3, 2026 18:03
@Sysix Sysix changed the base branch from graphite-base/17609 to 01-03-refactor_parser_pass_sourcetype_to_modulerecordbuilder_ January 3, 2026 18:03
@Sysix Sysix force-pushed the 01-03-refactor_parser_pass_sourcetype_to_modulerecordbuilder_ branch from db8c69a to 9394582 Compare January 3, 2026 18:11
@Sysix Sysix force-pushed the 01-03-feat_parser_add_ts1363_error_code branch 2 times, most recently from b3fcab6 to e9b08d8 Compare January 3, 2026 20:35
@github-actions github-actions bot added the A-linter Area - Linter label Jan 3, 2026
@Sysix Sysix requested a review from Copilot January 3, 2026 20:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for TypeScript error code TS1363, which validates that type-only imports cannot mix a default import with named bindings (e.g., import type A, { B } from 'mod' is invalid).

  • Implements validation logic in the module record builder to detect and report TS1363 errors
  • Adds the new diagnostic message for TS1363
  • Updates test cases to remove or comment out previously valid syntax that now correctly produces errors

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_parser/src/module_record.rs Adds TS1363 validation logic to check type-only import statements for mixed default and named bindings
crates/oxc_parser/src/diagnostics.rs Defines the TS1363 diagnostic message function
crates/oxc_parser/src/js/module.rs Removes test case for syntax that now correctly produces TS1363 error
crates/oxc_linter/src/rules/unicorn/require_module_specifiers.rs Comments out test case with invalid syntax
crates/oxc_linter/src/rules/typescript/no_import_type_side_effects.rs Comments out test case with invalid syntax
crates/oxc_linter/src/rules/import/no_empty_named_blocks.rs Comments out test case with invalid syntax and adds valid replacement
tasks/coverage/snapshots/parser_typescript.snap Updates snapshot to show TS1363 error instead of generic parse error
tasks/coverage/snapshots/parser_babel.snap Updates snapshot to show TS1363 error for previously failing test case
tasks/track_memory_allocations/allocs_parser.snap Updates memory allocation metrics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix force-pushed the 01-03-feat_parser_add_ts1363_error_code branch from e9b08d8 to 9a6519d Compare January 3, 2026 20:49
@Sysix Sysix marked this pull request as ready for review January 3, 2026 20:56
@Sysix Sysix requested a review from camc314 as a code owner January 3, 2026 20:56
@Sysix Sysix force-pushed the 01-03-feat_parser_add_ts1363_error_code branch from 9a6519d to 1c4968b Compare January 3, 2026 23:37
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

nice! 💪

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 5, 2026
@camc314 camc314 self-assigned this Jan 5, 2026
Copy link
Contributor

camc314 commented Jan 5, 2026

Merge activity

TS Playground: https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnAYhCARFAzAQwFcAbGAGjgG84AhAqS+gLzgF848oIQ4AiEBAAmpFHwDcQA

found in `tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/input.ts`

The span is not correct, but I think this is still better then nothing :)
The span should be only on the specifiers, not on the complete import declaration.
@graphite-app graphite-app bot force-pushed the 01-03-refactor_parser_pass_sourcetype_to_modulerecordbuilder_ branch from 9394582 to 1c07942 Compare January 5, 2026 08:58
@graphite-app graphite-app bot force-pushed the 01-03-feat_parser_add_ts1363_error_code branch from 1c4968b to 6870b64 Compare January 5, 2026 08:59
Base automatically changed from 01-03-refactor_parser_pass_sourcetype_to_modulerecordbuilder_ to main January 5, 2026 09:04
@graphite-app graphite-app bot merged commit 6870b64 into main Jan 5, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-03-feat_parser_add_ts1363_error_code branch January 5, 2026 09:05
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 5, 2026
graphite-app bot pushed a commit that referenced this pull request Jan 5, 2026
### 🚀 Features

- 659c23e linter: Init note field boilerplate  (#17589) (Shrey Sudhir)
- 6870b64 parser: Add TS1363 error code (#17609) (Sysix)
- 23680a3 mangler: Skip mangling only in scopes affected by direct eval (#17612) (camc314)
- a7e1643 parser: Add TS2528 error code to duplicate_default_export diagnostic (#17558) (camc314)

### 🐛 Bug Fixes

- 1044116 ecmascript: Mark `new Symbol` as non side-effect free (#17568) (camc314)
- ab5e4ca isolated-declarations: Strip default values from rest parameter binding patterns (#17602) (camc314)
- 68b2e54 minifier: Prevent incorrect ??= transformation when member base is mutated (#17472) (copilot-swe-agent)

### ⚡ Performance

- 6067143 semantic: Remove hash when checking identifier (#17564) (camchenry)
- a28ab3d semantic: Avoid bounds check when checking string literal (#17545) (camc314)
- 04809d1 semantic: Use SIMD for finding backslashes in `check_string_literal` (#17534) (camchenry)
- 49ad2f0 semantic: Mark all diagnostic functions as `#[cold]` (#17487) (camc314)
- ea82b50 transformer: Mark all diagnostic functions as `#[cold]` (#17486) (camc314)
- d968e51 semantic: Mark `checker::check` as `inline(always)` (#17459) (camc314)
graphite-app bot pushed a commit that referenced this pull request Jan 5, 2026
# Oxlint
### 💥 BREAKING CHANGES

- f7da875 oxlint: [**BREAKING**] Remove oxc_language_server binary (#17457) (Boshen)

### 🚀 Features

- 659c23e linter: Init note field boilerplate  (#17589) (Shrey Sudhir)
- 6870b64 parser: Add TS1363 error code (#17609) (Sysix)
- 6154c8c linter/eslint-plugin-vitest: Implemented vitest/warn-todo rule (#17228) (Said Atrahouch)
- 0043cd6 linter/eslint-plugin-vitest: Implement consistent-vitest-vi rule (#17389) (Said Atrahouch)
- a6d773d linter: Add full TS support to eslint/no-useless-constructor (#17592) (camc314)
- f02c0e7 linter/eslint: Implement complexity (#17569) (Nguyen Tran)
- bc7aae7 linter/no-unused-vars: Add fixer to remove unused catch bindings (#17567) (Don Isaac)
- 9e8ec78 linter/only-throw-error rule: Add `allowRethrowing` option for  (#17554) (camc314)
- b67e819 linter: Add fixer for `unicorn/prefer-response-static-json` rule (#17559) (Mikhail Baev)
- 44b0361 linter/vue: Implement no-this-in-before-route-enter (#17525) (yefan)
- ee34716 linter/react: Implement no-will-update-set-state (#17530) (Kenzo Wada)
- 3088e1d linter/react: Implement no-this-in-sfc (#17535) (Kenzo Wada)
- 29a2868 linter/jsx-a11y: Implement no-static-element-interactions (#17538) (Kenzo Wada)
- eadf057 linter: Enable tsconfig auto discovery by default (#17489) (Boshen)
- 12a7d6e website_linter: Add a count of rules with fixes available to rules table. (#17476) (Connor Shea)

### 🐛 Bug Fixes

- a702f13 oxlint/lsp: Correct position for "disable for this file" with shebang (#17613) (Sysix)
- 19fdfb6 linter: Panic in `sort-keys` rule with Unicode numeric characters (#17629) (Adel Rodríguez)
- 2e8f469 vscode: Search for `node_modules/.bin/oxlint.exe` too (bun setup) (#17597) (Sysix)
- be39906 linter/aria-proptypes: Allow template literals with expressions for string-type ARIA props (#17460) (Jökull Sólberg Auðunsson)
- 529901c linter: Include JS plugin rules when calculating total rule count (#17520) (connorshea)
- 96ef2cc linter: Print total rule # when using a single nested config (#17517) (connorshea)
- 9ad0f29 oxlint: Do not enable external plugin store when no external linter is passed (#17498) (Sysix)
- 174375d oxfmt,oxlint: Disable mimalloc for 32-bit Arm targets (#17473) (Yaksh Bariya)
- ff70fe9 linter/no-standalone-expect: Allows expect in wrapper functions passed to test blocks (#17427) (Copilot)
- dab232f linter/catch-or-return: Handle arrow functions with implicit returns correctly (#17440) (Copilot)
- a38892a linter: Update no-unnecessary-template-expression docs and test case (#17453) (camc314)

### ⚡ Performance

- 605dbf1 vscode: Restrict searching for oxlint/oxfmt binaries only 3 levels deep + 10s timeout (#17345) (Sysix)

### 📚 Documentation

- 884fb63 linter/react: Improve docs for jsx-curly-brace-presence (#17579) (connorshea)
- 1d3ee07 linter: Improve rule explanation for `vue/no-this-in-before-route-enter`. (#17581) (connorshea)
- 5f189f8 linter/arrow-body-style: Correctly document default mode option (#17566) (Rägnar O'ock)
- bb2e8e4 linter: Add a note to the `typescript/no-var-requires` rule about the missing `allow` option (#17551) (connorshea)
- 655afc1 linter: Improve docs for `import/extensions` and add a few more tests (#17539) (connorshea)
- 7e5fc90 linter: Update list of plugins that are reserved. (#17516) (connorshea)
# Oxfmt
### 💥 BREAKING CHANGES

- f7da875 oxlint: [**BREAKING**] Remove oxc_language_server binary (#17457) (Boshen)

### 🚀 Features

- 8fd4ea9 oxfmt: `options.embeddedLanguageFormatting` is now `"auto"` by default (#17649) (leaysgur)

### 🐛 Bug Fixes

- c9b5d7d formatter/sort_imports: Handle alignable_comment correctly (#17646) (leaysgur)
- 453222d formatter: Missing comment handling for end-of-line comments in member chains (#17659) (Dunqing)
- 0805ff2 formatter: Incorrect inline comment placement in try-catch (#17657) (Dunqing)
- 3a0c782 formatter: Don't move comments into optional call parentheses (#17582) (magic-akari)
- 174375d oxfmt,oxlint: Disable mimalloc for 32-bit Arm targets (#17473) (Yaksh Bariya)

### ⚡ Performance

- abb28dc oxfmt: Turn of pretty print from sort-package-json (#17452) (Boshen)
@fisker
Copy link

fisker commented Jan 5, 2026

Missed

import type foo, {  } from 'bar';

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnAZhCAaOBvOOAXwyghDgHIAjAQykoG4g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter A-parser Area - Parser C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants