A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/antfu/eslint-config/issues/227 below:

Add the `no-import-type-side-effects` rule to eliminate potential side effects · Issue #227 · antfu/eslint-config · GitHub

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4