Skip to content

feat(linter): noRestrictedImports add patterns option#4302

Closed
nekocode wants to merge 1 commit intobiomejs:mainfrom
nekocode:feat/no-restricted-imports-patterns-option
Closed

feat(linter): noRestrictedImports add patterns option#4302
nekocode wants to merge 1 commit intobiomejs:mainfrom
nekocode:feat/no-restricted-imports-patterns-option

Conversation

@nekocode
Copy link

@nekocode nekocode commented Oct 15, 2024

Summary

This PR add an option patterns similar to no-restricted-imports#patterns :

"noRestrictedImports": {
    "options": {
        "paths": {
             "import-foo": "Using import-foo is not encouraged"
        },
        "patterns": [{
             "group": ["import-foo/*", "!import-foo/a"],
             "message": "Using import-foo is not encouraged"
        }]
    }
}

Test Plan

Changed snapshots

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Oct 15, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2024

CodSpeed Performance Report

Merging #4302 will not alter performance

Comparing nekocode:feat/no-restricted-imports-patterns-option (4bcffbe) with main (561b54c)

Summary

✅ 92 untouched benchmarks

Copy link
Member

@Conaclos Conaclos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. I am holding this PR because we are in the process of merging it with useImportRestrictions. This needs some design work.

@nekocode nekocode force-pushed the feat/no-restricted-imports-patterns-option branch from 4bcffbe to 0dd2210 Compare October 15, 2024 15:27
@github-actions github-actions bot added the A-Changelog Area: changelog label Oct 15, 2024
@boennemann
Copy link

I just wanted to express that this rule would be highly beneficial for us. Is there a way to track progress on the merge with useImportRestrictions?

@rubencallewaert
Copy link

Now that useImportRestriction has been removed in favor of no-restricted-imports. Are there plans to support this patterns feature? It's an extremely important capability for us and holding us back from considering biome.

@siketyan
Copy link
Member

@rubencallewaert see #5289.

@ematipico
Copy link
Member

ematipico commented Mar 28, 2025

Closing as it has been stale for too long without updates. Follow #5289

@ematipico ematipico closed this Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments