@gulu9527/code-trust 0.1.0 → 0.2.1

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/index.d.ts CHANGED
@@ -105,6 +105,12 @@ declare class ScanEngine {
105
105
  declare function loadConfig(searchFrom?: string): Promise<CodeTrustConfig>;
106
106
  declare function generateDefaultConfig(): string;
107
107
 
108
+ interface Fix {
109
+ /** Byte range in the original file content [startOffset, endOffset) */
110
+ range: [number, number];
111
+ /** Replacement text (empty string = delete) */
112
+ text: string;
113
+ }
108
114
  interface Rule {
109
115
  id: string;
110
116
  category: RuleCategory;
@@ -112,6 +118,10 @@ interface Rule {
112
118
  title: string;
113
119
  description: string;
114
120
  check: (context: RuleContext) => Issue[];
121
+ /** Whether this rule supports auto-fix */
122
+ fixable?: boolean;
123
+ /** Generate a fix for a given issue. Returns null if unfixable. */
124
+ fix?: (context: RuleContext, issue: Issue) => Fix | null;
115
125
  }
116
126
  interface RuleContext {
117
127
  filePath: string;