Skip to content

Commit

Permalink
fix(linter): rule no-restricted-imports support missing options (#8076
Browse files Browse the repository at this point in the history
)

> 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)
  • Loading branch information
Sysix authored Jan 18, 2025
1 parent 8c6e0a6 commit 41f2070
Show file tree
Hide file tree
Showing 2 changed files with 659 additions and 367 deletions.
Loading

0 comments on commit 41f2070

Please sign in to comment.