-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add validation for import aliases (#1255)
* feat: do not allow invalid import aliases * chore: add changeset * fix: use validate instead of custom logic * fix: update changeset to better match changes * refactor: change naming from path alias to import alias --------- Co-authored-by: Christopher Ehrlich <ehrlich.christopher@gmail.com>
- Loading branch information
Showing
3 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-t3-app": minor | ||
--- | ||
|
||
Add import alias validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const validateImportAlias = (input: string) => { | ||
if (input.startsWith(".") || input.startsWith("/")) { | ||
return "Import alias can't start with '.' or '/'"; | ||
} else { | ||
return true; | ||
} | ||
}; |
601cbb2
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.
Successfully deployed to the following URLs:
create-t3-app – ./
create-t3-app-nu.vercel.app
create-t3-app-git-next-t3-oss.vercel.app
create-t3-app-t3-oss.vercel.app
ct3.app
create.t3.gg
beta.create.t3.gg
www.ct3.app