-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[no-restricted-paths] Add options to ignore certain import kinds #1900
base: main
Are you sure you want to change the base?
[no-restricted-paths] Add options to ignore certain import kinds #1900
Conversation
In this PR I haven't enforced the option being an enum, any strings can be given. With regard to whether there will be any other kinda of import, most likely not - but it's probably best to keep things flexible just in case. |
22a95d8
to
f8e4a91
Compare
6b6b975
to
7e9d9a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending schema change.
const allowedImportKindsSchema = { | ||
type: 'array', | ||
items: { | ||
type: 'string', | ||
}, | ||
uniqueItems: true, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do think we should restrict this for now to known import types. we can extend it in the future if needed, but we can't lock it down so easily.
This adds a new option called
"allowedImportKinds"
to the ruleno-restricted-paths
.This option defaults to an empty array and can be set to an array of strings.
This option allows imports of the specified kind(s) to be ignore by this rule.
Example use: