@yasainet/eslint 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -107,10 +107,21 @@ export const featureNameRule = {
|
|
|
107
107
|
if (!featureName) return {};
|
|
108
108
|
|
|
109
109
|
const projectRoot = filename.slice(0, rootIdx).replace(/\/src$/, "");
|
|
110
|
-
|
|
110
|
+
// Prefer the Supabase types file adjacent to `featureRoot` (e.g. `src/lib/...`
|
|
111
|
+
// for `src/features`). Fall back to `src/lib/...` at the project root so that
|
|
112
|
+
// non-`src` feature roots (e.g. `scripts/features`) can reuse the same
|
|
113
|
+
// generated types without duplicating the file.
|
|
114
|
+
const computedTypePath = path.join(
|
|
111
115
|
projectRoot,
|
|
112
116
|
featureRoot.replace(/features$/, "lib/supabase/supabase.type.ts"),
|
|
113
117
|
);
|
|
118
|
+
const fallbackTypePath = path.join(
|
|
119
|
+
projectRoot,
|
|
120
|
+
"src/lib/supabase/supabase.type.ts",
|
|
121
|
+
);
|
|
122
|
+
const supabaseTypePath = fs.existsSync(computedTypePath)
|
|
123
|
+
? computedTypePath
|
|
124
|
+
: fallbackTypePath;
|
|
114
125
|
|
|
115
126
|
const tableNames = extractTableNames(supabaseTypePath);
|
|
116
127
|
const allowedNames = ["shared", "auth", ...tableNames.map(toKebab)];
|