@sybelblue/prairielearn-navigator 1.1.2 → 1.1.3

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.
@@ -22,11 +22,24 @@ interface Exclude {
22
22
  base: string;
23
23
  glob: string;
24
24
  }
25
+ /** One exact diagnostic occurrence suppressed for one file. */
26
+ export interface IgnoredDiagnostic {
27
+ /** Absolute path of the file containing the diagnostic. */
28
+ file: string;
29
+ rule: RuleId;
30
+ /** Stable semantic identity, e.g. a question id, tag name, or set name. */
31
+ identifier?: string;
32
+ /** Exact message fallback for rules without a semantic identity. */
33
+ message?: string;
34
+ /** 1-based occurrence among diagnostics with this rule and message. */
35
+ occurrence?: number;
36
+ }
25
37
  export interface NavigatorConfig {
26
38
  plVersion: PlVersion;
27
39
  /** Absolute. */
28
40
  schemaCacheDir: string;
29
41
  rules: Partial<Record<RuleId, RuleSetting>>;
42
+ ignoredDiagnostics: IgnoredDiagnostic[];
30
43
  /** Files never checked. Every source adds to this rather than replacing it. */
31
44
  excludes: Exclude[];
32
45
  }
@@ -73,6 +86,7 @@ declare const fields: {
73
86
  plVersion: Field;
74
87
  schemaCacheDir: Field;
75
88
  excludes: Field;
89
+ ignoredDiagnostics: Field;
76
90
  rules: Field;
77
91
  };
78
92
  /** Every key a config source may set, besides `$schema`. */
@@ -25,6 +25,8 @@ export interface Diagnostic {
25
25
  message: string;
26
26
  severity: Severity;
27
27
  code?: string;
28
+ /** Stable rule-specific identity used for semantic suppressions when available. */
29
+ identifier?: string;
28
30
  related?: RelatedInfo[];
29
31
  metadata?: DiagnosticMetadata;
30
32
  }
@@ -18,6 +18,8 @@ export declare function runRules(filePath: string, text: string, options: {
18
18
  schemas: SchemaStore;
19
19
  references?: ReferenceIndex;
20
20
  }): Promise<Diagnostic[]>;
21
+ /** Removes exact per-file diagnostic occurrences suppressed in the config. */
22
+ export declare function withoutIgnoredDiagnostics(filePath: string, diagnostics: Diagnostic[], config: NavigatorConfig): Diagnostic[];
21
23
  /**
22
24
  * Runs the rules that look at a course as a whole rather than one file.
23
25
  * Returns diagnostics by the absolute path of the file each is shown on.