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

Add the no-import-type-side-effects rule to eliminate potential side effects #227

Closed
3 tasks done
lainbo opened this issue Jul 22, 2023 · 0 comments
Closed
3 tasks done
Labels
enhancement New feature or request

Comments

@lainbo
Copy link
Contributor

lainbo commented Jul 22, 2023

Clear and concise description of the problem

In TS 5.0, there is a option called verbatimModuleSyntax, which will cause the following issues.

import { type A, type B } from 'mod';

// is transpiled to

import {} from 'mod';
// which is the same as
import 'mod';

Suggested solution

In module eslint-config-ts, we can add the following rules to correct this potential side effect import.

"rules": {
  "@typescript-eslint/no-import-type-side-effects": "error"
}

Alternative

In the documentation of typescript-eslint, this issue has been mentioned

Additional context

No response

Validations

@lainbo lainbo added the enhancement New feature or request label Jul 22, 2023
@lainbo lainbo changed the title Add the "no-import-type-side-effects" rule to eliminate potential side effects Add the no-import-type-side-effects rule to eliminate potential side effects Jul 22, 2023
@antfu antfu closed this as completed in cb4b7b9 Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant