diff --git a/lib/modules/manager/bazel-module/parser.spec.ts b/lib/modules/manager/bazel-module/parser/index.spec.ts
similarity index 97%
rename from lib/modules/manager/bazel-module/parser.spec.ts
rename to lib/modules/manager/bazel-module/parser/index.spec.ts
index 4f6faef34e3a636c4a8a1f55884e6b6fdc7cb608..2424fa8018c4e45125a13de1c037f5b5152f328d 100644
--- a/lib/modules/manager/bazel-module/parser.spec.ts
+++ b/lib/modules/manager/bazel-module/parser/index.spec.ts
@@ -1,8 +1,8 @@
 import { codeBlock } from 'common-tags';
-import * as fragments from './fragments';
-import { parse } from './parser';
+import * as fragments from '../fragments';
+import { parse } from '.';
 
-describe('modules/manager/bazel-module/parser', () => {
+describe('modules/manager/bazel-module/parser/index', () => {
   describe('parse', () => {
     it('returns empty string if invalid content', () => {
       const input = codeBlock`
diff --git a/lib/modules/manager/bazel-module/parser/index.ts b/lib/modules/manager/bazel-module/parser/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e98d997e8754de32aa6c5809b7113a32b0f4153c
--- /dev/null
+++ b/lib/modules/manager/bazel-module/parser/index.ts
@@ -0,0 +1,19 @@
+import { lang, query as q } from 'good-enough-parser';
+import { Ctx } from '../context';
+import type { RecordFragment } from '../fragments';
+import { moduleRules } from './module';
+
+const rule = q.alt<Ctx>(moduleRules);
+
+const query = q.tree<Ctx>({
+  type: 'root-tree',
+  maxDepth: 16,
+  search: rule,
+});
+
+const starlarkLang = lang.createLang('starlark');
+
+export function parse(input: string): RecordFragment[] {
+  const parsedResult = starlarkLang.query(input, query, new Ctx());
+  return parsedResult?.results ?? [];
+}
diff --git a/lib/modules/manager/bazel-module/parser.ts b/lib/modules/manager/bazel-module/parser/module.ts
similarity index 58%
rename from lib/modules/manager/bazel-module/parser.ts
rename to lib/modules/manager/bazel-module/parser/module.ts
index 94391648597e69f594d835e366d52358ca2cf078..0c75234b6286204123d00a712e3a3a606e99f81c 100644
--- a/lib/modules/manager/bazel-module/parser.ts
+++ b/lib/modules/manager/bazel-module/parser/module.ts
@@ -1,8 +1,7 @@
-import { lang, query as q } from 'good-enough-parser';
-import { regEx } from '../../../util/regex';
-import { Ctx } from './context';
-import type { RecordFragment } from './fragments';
-import * as starlark from './starlark';
+import { query as q } from 'good-enough-parser';
+import { regEx } from '../../../../util/regex';
+import type { Ctx } from '../context';
+import * as starlark from '../starlark';
 
 const booleanValuesRegex = regEx(`^${starlark.booleanStringValues.join('|')}$`);
 const supportedRules = [
@@ -26,7 +25,7 @@ const kvParams = q
     q.sym<Ctx>(booleanValuesRegex, (ctx, token) => ctx.addBoolean(token.value)),
   );
 
-const moduleRules = q
+export const moduleRules = q
   .sym<Ctx>(supportedRulesRegex, (ctx, token) => ctx.startRule(token.value))
   .join(
     q.tree({
@@ -36,18 +35,3 @@ const moduleRules = q
       postHandler: (ctx, tree) => ctx.endRule(),
     }),
   );
-
-const rule = q.alt<Ctx>(moduleRules);
-
-const query = q.tree<Ctx>({
-  type: 'root-tree',
-  maxDepth: 16,
-  search: rule,
-});
-
-const starlarkLang = lang.createLang('starlark');
-
-export function parse(input: string): RecordFragment[] {
-  const parsedResult = starlarkLang.query(input, query, new Ctx());
-  return parsedResult?.results ?? [];
-}