@hyphaene/hexa-ts-kit 1.8.0 → 1.9.0
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.
|
@@ -840,6 +840,9 @@ var ContractsLintConfigSchema = z.object({
|
|
|
840
840
|
}),
|
|
841
841
|
disabledRules: z.array(z.string()).optional()
|
|
842
842
|
});
|
|
843
|
+
var VaultLintConfigSchema = z.object({
|
|
844
|
+
disabledRules: z.array(z.string()).optional()
|
|
845
|
+
});
|
|
843
846
|
var ContractsScaffoldConfigSchema = z.object({
|
|
844
847
|
path: z.string(),
|
|
845
848
|
// Absolute path to contracts lib
|
|
@@ -852,7 +855,8 @@ var ProjectConfigSchema = z.object({
|
|
|
852
855
|
var HexaTsKitConfigSchema = z.object({
|
|
853
856
|
project: ProjectConfigSchema,
|
|
854
857
|
lint: z.object({
|
|
855
|
-
contracts: ContractsLintConfigSchema.optional()
|
|
858
|
+
contracts: ContractsLintConfigSchema.optional(),
|
|
859
|
+
vault: VaultLintConfigSchema.optional()
|
|
856
860
|
}).optional(),
|
|
857
861
|
scaffold: z.object({
|
|
858
862
|
contracts: ContractsScaffoldConfigSchema.optional()
|
|
@@ -917,6 +921,9 @@ function resolveConfigPath(repoPath, relativePath) {
|
|
|
917
921
|
function getDisabledRules(config) {
|
|
918
922
|
return config.lint?.contracts?.disabledRules ?? [];
|
|
919
923
|
}
|
|
924
|
+
function getDisabledVaultRules(config) {
|
|
925
|
+
return config.lint?.vault?.disabledRules ?? [];
|
|
926
|
+
}
|
|
920
927
|
|
|
921
928
|
// src/lib/contracts/permissions-extractor.ts
|
|
922
929
|
import { readFileSync as readFileSync2, existsSync as existsSync3 } from "fs";
|
|
@@ -2485,6 +2492,8 @@ var vaultChecker = {
|
|
|
2485
2492
|
if (!vault) {
|
|
2486
2493
|
return results;
|
|
2487
2494
|
}
|
|
2495
|
+
const configResult = loadConfig(ctx.cwd);
|
|
2496
|
+
const disabledRules = configResult.success ? getDisabledVaultRules(configResult.config) : [];
|
|
2488
2497
|
const project = new Project({
|
|
2489
2498
|
skipAddingFilesFromTsConfig: true,
|
|
2490
2499
|
skipFileDependencyResolution: true
|
|
@@ -2499,7 +2508,12 @@ var vaultChecker = {
|
|
|
2499
2508
|
}
|
|
2500
2509
|
}
|
|
2501
2510
|
for (const sourceFile of sourceFiles) {
|
|
2502
|
-
|
|
2511
|
+
const astResults = checkAstPatterns(sourceFile);
|
|
2512
|
+
for (const result of astResults) {
|
|
2513
|
+
if (!disabledRules.includes(result.ruleId)) {
|
|
2514
|
+
results.push(result);
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2503
2517
|
}
|
|
2504
2518
|
return results;
|
|
2505
2519
|
}
|
package/dist/cli.js
CHANGED
package/dist/mcp-server.js
CHANGED