Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lucide-react, lucide-preact, lucide-react-native, lucide-solid, lucide-vue-next): Adjustable icon naming imports #2328

Merged
merged 17 commits into from
Nov 8, 2024

Conversation

ericfennis
Copy link
Member

@ericfennis ericfennis commented Jul 26, 2024

Closes #1830

Choosing import name style

Customize import name styles for lucide-react, lucide-vue, lucide-react-native, lucide-preact, to manage autocompletion in your IDE.

  1. Turn off autocomplete in your IDE:
    Add the following to your settings.json
{
  "typescript.preferences.autoImportFileExcludePatterns": [
    "lucide-react",
    "lucide-preact",
    "lucide-react-native",
    "lucide-vue-next"
  ]
}
  1. Create a custom module declaration file:

It allows you to choose the import name style.

For React:

declare module "lucide-react" {
  // Prefixed import names
  export * from "lucide-react/dist/lucide-react.prefixed";
  // or
  // Suffixed import names
  export * from "lucide-react/dist/lucide-react.suffixed";
}

For Vue:

declare module "lucide-vue-next" {
  // Prefixed import names
  export * from "lucide-vue-next/dist/lucide-vue-next.prefixed";
  // or
  // Suffixed import names
  export * from "lucide-vue-next/dist/lucide-vue-next.suffixed";
}

See documentation

@github-actions github-actions bot added 📖 documentation Improvements or additions to documentation 📦 dependencies Pull requests that update a dependency file 🌍 site Has to do something with the Lucide website ⚛️ react package Lucide React Package ⚛️ preact package About the Preact Package ⚛️ react native package About the React Native package 🅰️ angular package About the Angular package labels Jul 26, 2024
@github-actions github-actions bot added the Stale label Aug 26, 2024
@github-actions github-actions bot added 🎨 icon About new icons 🫧 metadata Improved metadata labels Sep 6, 2024
@ericfennis ericfennis marked this pull request as ready for review September 6, 2024 14:24
@github-actions github-actions bot removed the Stale label Sep 7, 2024
@lucide-icons lucide-icons deleted a comment from github-actions bot Sep 13, 2024
@ericfennis ericfennis removed the Stale label Oct 30, 2024
@ericfennis ericfennis merged commit b177743 into main Nov 8, 2024
25 of 26 checks passed
@ericfennis ericfennis deleted the adjustable-icon-naming-imports branch November 8, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🅰️ angular package About the Angular package 📦 dependencies Pull requests that update a dependency file 📖 documentation Improvements or additions to documentation 🎨 icon About new icons 🫧 metadata Improved metadata ⚛️ preact package About the Preact Package ⚛️ react native package About the React Native package ⚛️ react package Lucide React Package 🌍 site Has to do something with the Lucide website 💎 vue package Lucide Vue package
Projects
None yet
1 participant