import-js/eslint-plugin-import

[import/no-duplicates] `{"prefer-inline": true}` does not work

開放

#2,715 建立於 2023年2月12日

 (14 則留言) (13 個反應) (0 位負責人)JavaScript (1,548 個分叉)batch import
bughelp wantedtypescript

倉庫指標

星標
 (5,940 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

version 2.27.5

https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports The documentation states that adding {"prefer-inline": true} as shown below will cause errors and autofixes if there are duplicate imports. However, this was not possible in my environment.

{
  "import/no-duplicates": ["error", {"prefer-inline": true}],
}

It should look like the following, but there is no error or anything.

import NextErrorComponent from 'next/error';
import { type ErrorProps } from 'next/error';
// ↓
import NextErrorComponent, { type ErrorProps } from 'next/error';

image

Is this currently being corrected?

貢獻者指南