From b419ef1cb696029219ab6d3da84b8122be72d35a Mon Sep 17 00:00:00 2001 From: Loris Witschard Date: Wed, 22 May 2024 19:32:39 +0200 Subject: [PATCH] fix(eslint-plugin-qwik): allow loaders in routes with JSX extension fix #6361 --- packages/eslint-plugin-qwik/src/loaderLocation.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin-qwik/src/loaderLocation.ts b/packages/eslint-plugin-qwik/src/loaderLocation.ts index ad6b71468f0..4097291104f 100644 --- a/packages/eslint-plugin-qwik/src/loaderLocation.ts +++ b/packages/eslint-plugin-qwik/src/loaderLocation.ts @@ -56,9 +56,9 @@ If you understand this, you can disable this warning with: create(context) { const routesDir = context.options?.[0]?.routesDir ?? 'src/routes'; const path = normalizePath(context.getFilename()); - const isLayout = /\/layout(|!|-.+)\.tsx?$/.test(path); - const isIndex = /\/index(|!|@.+)\.tsx?$/.test(path); - const isPlugin = /\/plugin(|@.+)\.tsx?$/.test(path); + const isLayout = /\/layout(|!|-.+)\.(j|t)sx?$/.test(path); + const isIndex = /\/index(|!|@.+)\.(j|t)sx?$/.test(path); + const isPlugin = /\/plugin(|@.+)\.(j|t)sx?$/.test(path); const isInsideRoutes = new RegExp(`/${routesDir}/`).test(path); const canContainLoader = isInsideRoutes && (isIndex || isLayout || isPlugin);