Skip to content

Commit 2db17f1

Browse files
committed
fix: add missing loadModule
1 parent 4efc5f1 commit 2db17f1

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.changeset/mighty-tomatoes-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-svelte-tailwindcss": minor
3+
---
4+
5+
Fix missing `loadModule`

packages/plugin/src/workers/config-v4.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,34 @@ const loadV4 = async (baseDir: string, pkgDir: string, entryPoint: null | string
152152
return {};
153153
}
154154
}),
155+
156+
// v4.0.0-alpha.25+
157+
loadModule: createLoader({
158+
filepath: entryPoint,
159+
jiti,
160+
legacy: false,
161+
onError: (id, err, resourceType) => {
162+
console.error(`Unable to load ${resourceType}: ${id}`, err);
163+
164+
if (resourceType === 'config') {
165+
return {};
166+
}
167+
168+
return () => {};
169+
}
170+
}),
171+
172+
// v4.0.0-alpha.24 and below
173+
loadPlugin: createLoader({
174+
filepath: entryPoint,
175+
jiti,
176+
legacy: true,
177+
onError(id, err) {
178+
console.error(`Unable to load plugin: ${id}`, err);
179+
return () => {};
180+
}
181+
}),
182+
155183
loadStylesheet: async (id: string, base: string) => {
156184
const resolved = resolveCssFrom(base, id);
157185

0 commit comments

Comments
 (0)