pasika 0.10.11 → 0.10.12
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/dist/eslint/pasika/index.js +12 -0
- package/package.json +1 -1
|
@@ -1865,6 +1865,12 @@ function expectedSupportFolder(kinds) {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
return void 0;
|
|
1867
1867
|
}
|
|
1868
|
+
function mixedSupportKinds(folder, kinds) {
|
|
1869
|
+
if (folder === "types") return kinds.has("type") && (kinds.has("constant") || kinds.has("schema"));
|
|
1870
|
+
if (folder === "schemas") return kinds.has("schema") && kinds.has("constant");
|
|
1871
|
+
if (folder === "constants") return kinds.has("constant") && kinds.has("schema");
|
|
1872
|
+
return false;
|
|
1873
|
+
}
|
|
1868
1874
|
function configModuleRoot(filename, sourceRoot) {
|
|
1869
1875
|
const segments = segmentsOf(filename, sourceRoot);
|
|
1870
1876
|
if (segments[0] !== "config" || segments.length < 3) return void 0;
|
|
@@ -1991,6 +1997,12 @@ var applicationStructureRule = {
|
|
|
1991
1997
|
`A support folder must not contain a component; move ${path13.basename(filename)} beside ${currentFolder}/.`
|
|
1992
1998
|
);
|
|
1993
1999
|
}
|
|
2000
|
+
if (mixedSupportKinds(currentFolder, kinds)) {
|
|
2001
|
+
return report2(
|
|
2002
|
+
context,
|
|
2003
|
+
`A ${currentFolder}/ folder must not mix unrelated support kinds; keep types, schemas, and constants in their matching folders.`
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
1994
2006
|
const expected = expectedSupportFolder(kinds);
|
|
1995
2007
|
if (expected !== void 0 && expected !== currentFolder) {
|
|
1996
2008
|
return report2(
|