feat(rome_js_analyze): new lint rule: useImportRestrictions#4700
Conversation
❌ Deploy Preview for docs-rometools failed.Built without sensitive environment variables
|
ematipico
left a comment
There was a problem hiding this comment.
I left some suggestions around:
- documentation
- implementation
Documentation: it should be more beginner-friendly
Implementation: using PathBuf add complexity that we don't need. I believe working with strings is a more suitable approach where we don't need to deal with OS specific stuff.
|
I think all the PR issues have been addressed, just need to know what to do with the |
Nothing, that's the tool doing its job. Thank you! |
ematipico
left a comment
There was a problem hiding this comment.
A couple of suggestions, and then we can merge!
|
|
||
| const INDEX_BASENAMES: &[&str] = &["index", "mod"]; | ||
|
|
||
| const SOURCE_EXTENSIONS: &[&str] = &["js", "ts", "cjs", "cts", "mjs", "mts", "jsx", "tsx"]; |
There was a problem hiding this comment.
Should we consider .d.ts too? Genuine question, I don't know it :)
There was a problem hiding this comment.
I don't think it makes sense to be honest, since you can't import "some_file.d.ts".
|
All done 👍 |
Summary
This PR implements the initial version of the new
useImportRestrictionsas discussed in #4678I think I have taken all the feedback from the previous PR into account now.
Test Plan
Tests are included in the PR.