miaoda-expo-devkit 0.1.1-beta.34 → 0.1.1-beta.36
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/cli/lint.js
CHANGED
|
@@ -9,15 +9,27 @@ var oxlintConfig = (0, import_node_path.join)(devkitRoot, "oxlint-config.json");
|
|
|
9
9
|
var biomeConfig = (0, import_node_path.join)(devkitRoot, "biome-config.json");
|
|
10
10
|
var targets = process.argv.slice(2);
|
|
11
11
|
var lintTargets = targets.length > 0 ? targets : ["."];
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
stdio: "inherit"
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
var results = [];
|
|
13
|
+
function run(name, cmd, args) {
|
|
14
|
+
const r = (0, import_node_child_process.spawnSync)(cmd, args, { stdio: "inherit" });
|
|
15
|
+
results.push({ name, ok: (r.status ?? 1) === 0 });
|
|
16
|
+
}
|
|
17
|
+
run("oxlint", "oxlint", ["--config", oxlintConfig, ...lintTargets]);
|
|
18
|
+
run("biome", "biome", ["lint", "--config-path", biomeConfig, ...lintTargets]);
|
|
19
|
+
run("tsc", "tsc", ["--noEmit"]);
|
|
20
|
+
var failed = results.filter((r) => !r.ok);
|
|
21
|
+
if (failed.length > 0) {
|
|
22
|
+
const names = failed.map((r) => r.name).join(", ");
|
|
23
|
+
console.error(`
|
|
24
|
+
${"\u2500".repeat(60)}`);
|
|
25
|
+
console.error(`RESULT: FAILED \u2014 Found errors in: ${names}`);
|
|
26
|
+
console.error(`Fix all errors above, then re-run 'npm run lint'.`);
|
|
27
|
+
console.error("\u2500".repeat(60));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
} else {
|
|
30
|
+
console.log(`
|
|
31
|
+
${"\u2500".repeat(60)}`);
|
|
32
|
+
console.log("RESULT: PASSED \u2014 All checks passed.");
|
|
33
|
+
console.log("\u2500".repeat(60));
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
@@ -54,13 +54,21 @@ function getRouterRoot(projectRoot) {
|
|
|
54
54
|
return ".";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
function hasLayoutFile(dir) {
|
|
58
|
+
for (const ext of ROUTE_EXTS) {
|
|
59
|
+
if (import_node_fs.default.existsSync(import_node_path.default.join(dir, `_layout${ext}`))) return true;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
57
63
|
function collectRoutesNeedingHide(layoutDir) {
|
|
58
64
|
const results = [];
|
|
59
65
|
function scan(dir) {
|
|
60
66
|
for (const entry of import_node_fs.default.readdirSync(dir, { withFileTypes: true })) {
|
|
61
67
|
const fullPath = import_node_path.default.join(dir, entry.name);
|
|
62
68
|
if (entry.isDirectory()) {
|
|
63
|
-
|
|
69
|
+
if (!hasLayoutFile(fullPath)) {
|
|
70
|
+
scan(fullPath);
|
|
71
|
+
}
|
|
64
72
|
continue;
|
|
65
73
|
}
|
|
66
74
|
if (!entry.isFile()) continue;
|
package/oxlint-config.json
CHANGED
|
@@ -40,6 +40,21 @@
|
|
|
40
40
|
"react/jsx-no-undef": "error"
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
+
"ignorePatterns": [
|
|
44
|
+
"metro.config.js",
|
|
45
|
+
"babel.config.js",
|
|
46
|
+
"output/**"
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
"overrides": [
|
|
50
|
+
{
|
|
51
|
+
"files": ["tailwind.config.js", "**/tailwind.config.js"],
|
|
52
|
+
"env": {
|
|
53
|
+
"node": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
|
|
43
58
|
"env": {
|
|
44
59
|
"browser": true
|
|
45
60
|
},
|