Skip to content

Commit

Permalink
fix(config): Enhance ReactConfig and improve file handling logic (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelooter authored Dec 20, 2024
1 parent 7b616be commit 1a893b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class FileManager(private val project: Project) {
)
}
}).filter { file ->
!file.path.contains("/node_modules/") && !file.path.contains("/.git/")
!file.path.contains("/node_modules/")
&& !file.path.contains("/.git/")
&& !file.parent.name.startsWith('.')
}.sortedBy { file ->
name.toRegex().find(file.path)?.range?.first ?: Int.MAX_VALUE
}.also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ReactConfig(
val rsc: Boolean = false,
val tsx: Boolean = true,
override val tailwind: Tailwind,
override val aliases: Aliases
override val aliases: Aliases,
val iconLibrary: String? = null

Check warning on line 23 in src/main/kotlin/com/github/warningimhack3r/intellijshadcnplugin/backend/sources/config/ReactConfig.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "iconLibrary" is never used
) : Config() {

/**
Expand Down Expand Up @@ -49,6 +50,8 @@ class ReactConfig(
class Aliases(
val components: String,
val utils: String,
val ui: String? = null
val ui: String? = null,
val lib: String? = null,
val hooks: String? = null

Check warning on line 55 in src/main/kotlin/com/github/warningimhack3r/intellijshadcnplugin/backend/sources/config/ReactConfig.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "hooks" is never used
) : Config.Aliases()
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ class ReactReplacementsTests : ReplacementsTests() {
aliases = ReactConfig.Aliases(
components = "@/components",
utils = "@/lib/utilsReplaced",
ui = if (useNotNullUI) "@/ui" else null
)
ui = if (useNotNullUI) "@/ui" else null,
lib = "@/lib",
hooks = "@/hooks"
),
iconLibrary = "lucide"
)

public override fun adaptFileToConfig(file: PsiFile) {
Expand Down

0 comments on commit 1a893b1

Please sign in to comment.