-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
fix(linter): add option "allowTypeImports" for rule "no-restricted-imports" #7894
base: main
Are you sure you want to change the base?
fix(linter): add option "allowTypeImports" for rule "no-restricted-imports" #7894
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
CodSpeed Performance ReportMerging #7894 will not alter performanceComparing Summary
|
… option inside `patterns`
…ld regex in `from_configuration`
…-linter-no-restricted-imports-improve-diagnostics
…nto bugfix-linter-add-option-allow-type-imports-for-no-restricted-imports
@@ -1832,6 +2600,270 @@ fn test() { | |||
// ), | |||
]; | |||
|
|||
let fail_typescript = vec![ | |||
("import foo from 'import1';", Some(serde_json::json!(["import1", "import2"]))), | |||
// ("import foo = require('import1');", Some(serde_json::json!(["import1", "import2"]))), |
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.
@camc314 should we support this?
Notice the import
at the start. There is no entry in ModuleRecord
for it.
I searched a bit on the internet and it looks like this is a old syntax.
There is 2 options how to solve this:
- fix
ModuleRecord
to implement this use case - loops to the AST nodes and find the require
I am not that good in typescript to understand what the best solution is for the absurd syntax
waiting for #8113