Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

import-blacklist regex #4491

Closed
pburkindine opened this issue Jan 30, 2019 · 4 comments
Closed

import-blacklist regex #4491

pburkindine opened this issue Jan 30, 2019 · 4 comments

Comments

@pburkindine
Copy link

pburkindine commented Jan 30, 2019

Feature request

Is your feature request related to a problem? Please describe.
I would really like to be able to add a regex to the import-blacklist

Describe the solution you'd like

e.g.

"^\@some-lib\/internal\/.*$"
@JoshuaKGoldberg
Copy link
Contributor

Thanks for the suggestion @pburkindine! Agreed that this would be useful, but this looks like it's a bit tricky. Since the configuration already allows direct string comparisons with / forward slashes, there would need to be some way to indicate whether a blacklisted string is a regular string or meant to be a regex.

@Cuberice
Copy link

Cuberice commented Feb 5, 2019

This would be very beneficial when using non-relative path import in the tsconfig.json to disallow imports like app/ or ../../module. Currently I have to replicate the paths in both tsconfig and tslint

@jamietre
Copy link

jamietre commented Mar 6, 2019

This is supported in 5.13.0, issue can be closed.

@JoshuaKGoldberg
Copy link
Contributor

Good catch! #3504

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants