Skip to content

Commit

Permalink
fix(eslint-plugin-qwik): allow loaders in routes with JSX extension
Browse files Browse the repository at this point in the history
fix #6361
  • Loading branch information
loriswit committed May 22, 2024
1 parent cae4e5b commit b419ef1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/eslint-plugin-qwik/src/loaderLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b419ef1

Please sign in to comment.