File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Developing CSAF Validator Lib
2
+
3
+ ## Table of Contents
4
+ - [ Code Style] ( #code-style )
5
+ - [ Formatting with prettier] ( #formatting-with-prettier )
6
+ - [ Quoting Strings] ( #quoting-strings )
7
+
8
+
9
+ ## Code Style
10
+
11
+ ### Formatting with prettier
12
+
13
+ JavaScript code must be formatted with Prettier before it can be pushed to the repository.
14
+ A prettier.config.cjs is provided.
15
+
16
+ ### Quoting Strings
17
+
18
+ Strings have to be quoted in the following way:
19
+
20
+ - ** Single quotes ''**
21
+ - We use ` '' ` (single quotes) when the string has no expressions inside.
22
+
23
+ - ** Template literals (backticks)**
24
+ - We use ` `` ` (template literals) when there is an expression to resolve in the string, e.g. ${metricIndex}
25
+
26
+ - ** Quotation mark in string**
27
+ - We use ` "" ` (double quotation marks) in strings to mark text in messages
28
+
29
+ ** Examples:**
30
+
31
+ Simple Message:
32
+
33
+ ```
34
+ message: 'value is not consistent with the vector string',
35
+ ```
36
+
37
+ Message with expression inside
38
+
39
+ ```
40
+ message: `branch structure nesting exceeds "${MAX_DEPTH}" branches (it is ${count} levels deep)`
41
+ ```
42
+
43
+ Message with "" inside
44
+
45
+ ```
46
+ message:
47
+ 'the ssvc id does neither match the "cve" nor it '+
48
+ 'matches the "text" of any item in the "ids" array',
49
+ ```
You can’t perform that action at this time.
0 commit comments