Skip to content

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Dec 14, 2024

closes #7810

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 14, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added the A-linter Area - Linter label Dec 14, 2024
@Sysix Sysix changed the title bugfix(linter): add option "allowTypeImports" for rule "no-restricted-imports" fix(linter): add option "allowTypeImports" for rule "no-restricted-imports" Dec 14, 2024
@github-actions github-actions bot added the C-bug Category - Bug label Dec 14, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 14, 2024

CodSpeed Performance Report

Merging #7894 will not alter performance

Comparing Sysix:bugfix-linter-add-option-allow-type-imports-for-no-restricted-imports (4f9e1d5) with main (9bc3017)

Summary

✅ 33 untouched benchmarks

Boshen pushed a commit that referenced this pull request Jan 18, 2025
)

> The regex property is used to specify the regex patterns for
restricting modules.
> Note: regex cannot be used in combination with group.

_https://eslint.org/docs/latest/rules/no-restricted-imports#regex_

> This option allows you to use regex patterns to restrict import names:


_https://eslint.org/docs/latest/rules/no-restricted-imports#importnamepattern_

> This is a string option. Inverse of importNamePattern, this option
allows imports that matches the specified regex pattern. So it restricts
all imports from a module, except specified allowed patterns.
> Note: allowImportNamePattern cannot be used in combination with
importNames, importNamePattern or allowImportNames.


_https://eslint.org/docs/latest/rules/no-restricted-imports#allowimportnamepattern_

Needed to install `regress` to support JS Sntax like Lookaheads and
Lookbehinds

Next Goals:
- #7894
- Improve spans
- Error for wrong configurations
- update documentation
- Output messages like
[eslint](https://github.com/eslint/eslint/blob/main/lib/rules/no-restricted-imports.js#L140-L184)
@Sysix Sysix marked this pull request as ready for review February 22, 2025 23:16
@Boshen Boshen requested review from camc314 and shulaoda February 23, 2025 02:51
Copy link
Member

@shulaoda shulaoda left a comment

Choose a reason for hiding this comment

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

LGTM

@Sysix Sysix merged commit 3031845 into oxc-project:main Feb 23, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: no-restricted-imports missing option support for allowTypeImports, allowImportNames, group, ..

2 participants