File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ interface AstAnalyserOptions {
31
31
/**
32
32
* @default false
33
33
*/
34
- optionalWarnings? : boolean | Iterable <string >;
34
+ optionalWarnings? : boolean | Iterable <OptionalWarningName >;
35
35
}
36
36
```
37
37
@@ -47,13 +47,14 @@ class AstAnalyser {
47
47
options ? : RuntimeOptions
48
48
) => Report ;
49
49
analyseFile(
50
- pathToFile : string ,
50
+ pathToFile : string | URL ,
51
51
options ? : RuntimeFileOptions
52
52
): Promise <ReportOnFile >;
53
53
analyseFileSync(
54
- pathToFile : string ,
54
+ pathToFile : string | URL ,
55
55
options ? : RuntimeFileOptions
56
56
): ReportOnFile ;
57
+ prepareSource(source : string , options ? : PrepareSourceOptions ): string
57
58
}
58
59
```
59
60
@@ -148,7 +149,14 @@ export const customProbes = [
148
149
main : (node , options ) => {
149
150
const { sourceFile, data : calleeName } = options ;
150
151
if (node .declarations [0 ].init .value === " danger" ) {
151
- sourceFile .addWarning (" unsafe-danger" , calleeName , node .loc );
152
+ sourceFile .warnings .push ({
153
+ kind: " unsafe-danger" ,
154
+ value: calleeName ,
155
+ location: node .loc ,
156
+ source: " JS-X-Ray Custom Probe" ,
157
+ i18n: " sast_warnings.unsafe-danger" ,
158
+ severity: " Warning"
159
+ });
152
160
153
161
return ProbeSignals .Skip ;
154
162
}
You can’t perform that action at this time.
0 commit comments