Remove certain references to ../

Relative path parenting must already be done explicitly and is not up for discussion.
This commit is contained in:
Varun Saini 2024-09-11 16:25:04 -07:00
parent 7bd864c256
commit 12614181d0

View file

@ -55,9 +55,9 @@ The main drawback of this approach is that projects with many _external_ depende
This is similar to [Lune's approach](https://lune-org.github.io/docs/getting-started/2-introduction/8-modules#file-require-statements) and is identical to the approach currently described in [require-by-string-aliases.md](require-by-string-aliases.md). This is similar to [Lune's approach](https://lune-org.github.io/docs/getting-started/2-introduction/8-modules#file-require-statements) and is identical to the approach currently described in [require-by-string-aliases.md](require-by-string-aliases.md).
#### (1b) Make relative paths explicit with either `./` or `../` prefix #### (1b) Make relative paths explicit with `./` prefix
We make usage of either the `./` or `../` prefix necessary in relative require statements. We make usage of the `./` prefix necessary in relative require statements.
This means that any unprefixed string is always treated as an aliased path. This means that any unprefixed string is always treated as an aliased path.
```luau ```luau
-- Requires /My/Libraries/Directory/dependency.luau -- Requires /My/Libraries/Directory/dependency.luau
@ -70,7 +70,7 @@ require("./libs/dependency")
require("@libs/dependency") require("@libs/dependency")
``` ```
The main drawback of this approach is that projects with many _internal_ dependencies will have many `./` and `../` symbols appearing within require statements. The main drawback of this approach is that projects with many _internal_ dependencies will have many `./` symbols appearing within require statements.
This is similar to [darklua's approach](https://darklua.com/docs/path-require-mode/). This is similar to [darklua's approach](https://darklua.com/docs/path-require-mode/).