Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verbatim-module-syntax should not fix by adding type keyword to import decl with named and default imports #1382

Open
dsherret opened this issue Dec 30, 2024 · 0 comments

Comments

@dsherret
Copy link
Member

dsherret commented Dec 30, 2024

Given:

import React, { useState } from 'react';
useState(true);
export type Test = React;

This is wrong:

import type React, { useState } from 'react';
useState(true);
export type Test = React;
error: TS1363 [ERROR]: A type-only import can specify a default import or named bindings, but not both.
import type React, { useRef, useState } from "react";
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///home/runner/work/ts-ast-viewer/ts-ast-viewer/src/components/Options.tsx:1:[8](https://github.com/dsherret/ts-ast-viewer/actions/runs/12549999832/job/34992017213?pr=163#step:7:9)

This is right:

import type React from "react";
import { useState } from 'react';
useState(true);
export type Test = React;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant