Skip to content

Commit 3f734db

Browse files
rubin55dummdidumm
andauthored
fix: config discovery under dot directories (#3121)
* fix: config discovery under dot directories * Update .changeset/fix-config-crawl-dot-ancestor.md --------- Co-authored-by: Simon H <[email protected]>
1 parent 2a80d78 commit 3f734db

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte-language-server': patch
3+
---
4+
5+
fix: ensure config discovery when the workspace sits under a dot directory.

‎packages/language-server/src/lib/documents/configLoader.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ export class ConfigLoader {
132132

133133
const pathResults = new this.globSync({})
134134
.withPathSeparator('/')
135-
.exclude((_, path) => {
136-
// no / at the start, path could start with node_modules
137-
return path.includes('node_modules/') || path.includes('/.') || path[0] === '.';
135+
.exclude((dirName) => {
136+
return dirName === 'node_modules' || dirName.startsWith('.');
138137
})
139138
.filter((path, isDir) => {
140139
return !isDir && targetRegex.test(path);

0 commit comments

Comments
 (0)