Skip to content

Rule Change: Avoid fix for duplicate imports with condition #441

@Tanujkanti4441

Description

@Tanujkanti4441

What rule do you want to change?

no-duplicate-imports

What change do you want to make?

Implement suggestions

How do you think the change should be implemented?

Other

Example code

@import 'test.css' print;
@import 'test.css';

/* OR */

@import 'test.css' (min-width: 800px);
@import 'test.css';

/* OR */

@import 'test.css' layer(base);
@import 'test.css' layer(components);

What does the rule currently do for this code?

Right now, Rule reports the second import as a duplicate and removes it as an autofix. But what if one @import has some import condition with it and the other doesn't, or both have different import conditions to apply? Then, in such conditions, autofix can impact the functionality.

What will the rule do after it's changed?

The rule will not apply autofix when it finds duplicate imports with different import conditions.

Participation

  • I am willing to submit a pull request to implement this change.

AI acknowledgment

  • I did not use AI to generate this issue report.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

Additional comments

No response

Metadata

Metadata

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionenhancementNew feature or request

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions