Skip to content

no-duplicates with prefer-inline produces invalid syntax for fix when something named "from" is imported #3224

@Quantaly

Description

@Quantaly

Using eslint@9.39.2, eslint-plugin-import@2.32.0

Input:

import type {Observable} from 'rxjs';
import {from} from 'rxjs';

import/no-duplicates is set to ['error', {'prefer-inline': true}], and correctly flags this as erroneous. When I run eslint --fix, it changes the code to the following:

import {type Observable,from} type from 'rxjs';

which is incorrect and causes a parser error (note the extra type before the from).

For the sake of completeness, the expected result would be:

import {type Observable,from} from 'rxjs';

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions