question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove default aliases

See original GitHub issue

Describe the feature

Right now, default path aliases like ~ or @@ can’t be deleted, only overridden.

Would it make sense to alter the code so setting them to a falsy value like undefined or '' in the nuxt.config.ts would remove them entirely?

Related: https://github.com/nuxt/framework/discussions/7274

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
danielroecommented, Sep 20, 2022

If what you want to do is remove it from autocomplete then you can do this:

export default defineNuxtConfig({
  hooks: {
    'prepare:types' ({ tsConfig }) {
      const aliasesToRemoveFromAutocomplete = ['~~', '~~/*']
      for (const alias of aliasesToRemoveFromAutocomplete) {
        if (tsConfig.compilerOptions.paths[alias]) {
          delete tsConfig.compilerOptions.paths[alias]
        }
      }
    }
  }
})
3reactions
pi0commented, Sep 6, 2022

I would be happy to continue discussion why this is needed. Such customization for built-ins can possibly break many things like modules or config depending on aloases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove default aliases ? : r/zsh - Reddit
One of the first things I do in .zshenv is to disable any loading of /etc/z* ... On arch there are no aliases...
Read more >
How to remove alias on Linux - LinuxConfig.org
In this tutorial, we show how to remove a temporary or permanent alias that has been configured on a Linux system.
Read more >
Remove-Alias (Microsoft.PowerShell.Utility) - Microsoft Learn
The Remove-Alias cmdlet removes an alias from the current PowerShell session. To remove an alias with the Option property set to ReadOnly, use...
Read more >
How do I remove an alias? - command line - Ask Ubuntu
The command to remove an alias is unalias so.... unalias gs. Manual: NAME. unalias - remove alias definitions. SYNOPSIS
Read more >
How do I permanently remove an Alias from my Shell
If unalias removes the issue (even temporarily) we have confirmation it is an alias. It could be "brute forced" out by adding an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found