Closed tackley closed 4 months ago
[puLL-Merge] - brave/ads-ui@1170
Here is my review of the pull request:
This PR updates import statements throughout the codebase to use absolute imports with a @
alias pointing to the src
directory. This allows importing modules using a consistent syntax like import { Foo } from "@/path/to/Foo"
rather than relative paths like import { Foo } from "../../path/to/Foo"
.
No obvious security issues. The changes are limited to updating import statements which should not introduce any vulnerabilities.
The use of absolute imports with an alias has a few benefits:
Overall this is a straightforward refactor that improves the developer experience without changing any functionality. The changes look good to me and I would approve this PR.
Let me know if you have any other questions!
Use
@/name
for app imports, as opposed to justname
as previously. This is the modern convention for web apps, and makes clearer when imports are coming from the application as opposed to npm modules.There's a few deep
../../
style imports remaining - these get worse if I move them to@/
-style imports, and I think are better left until we move the files around a bit more in a subsequent PR.