ilib-lint 1.0.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.
- package/LICENSE +201 -0
- package/README.md +231 -0
- package/docs/AnsiConsoleFormatter.html +467 -0
- package/docs/Formatter.html +577 -0
- package/docs/Formatter.js.html +135 -0
- package/docs/FormatterFactory.html +191 -0
- package/docs/FormatterFactory.js.html +109 -0
- package/docs/Parser.html +483 -0
- package/docs/Parser.js.html +122 -0
- package/docs/ParserFactory.js.html +109 -0
- package/docs/Plugin.html +847 -0
- package/docs/Plugin.js.html +168 -0
- package/docs/PluginManager.html +541 -0
- package/docs/PluginManager.js.html +125 -0
- package/docs/ResourceICUPlurals.html +278 -0
- package/docs/ResourceQuoteStyle.html +278 -0
- package/docs/ResourceRegExpChecker.html +295 -0
- package/docs/ResourceUniqueKeys.html +278 -0
- package/docs/Result.html +263 -0
- package/docs/Result.js.html +130 -0
- package/docs/Rule.html +774 -0
- package/docs/Rule.js.html +230 -0
- package/docs/RuleSet.html +760 -0
- package/docs/RuleSet.js.html +153 -0
- package/docs/SourceFile.html +826 -0
- package/docs/SourceFile.js.html +232 -0
- package/docs/XliffParser.html +396 -0
- package/docs/XliffPlugin.html +472 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/formatters_AnsiConsoleFormatter.js.html +147 -0
- package/docs/global.html +448 -0
- package/docs/ilibLint.md +1013 -0
- package/docs/index.html +81 -0
- package/docs/plugins_XliffParser.js.html +129 -0
- package/docs/plugins_XliffPlugin.js.html +129 -0
- package/docs/rules_ResourceICUPlurals.js.html +297 -0
- package/docs/rules_ResourceQuoteStyle.js.html +238 -0
- package/docs/rules_ResourceRegExpChecker.js.html +248 -0
- package/docs/rules_ResourceUniqueKeys.js.html +144 -0
- package/docs/scripts/collapse.js +20 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +83 -0
- package/docs/styles/jsdoc.css +765 -0
- package/docs/styles/prettify.css +79 -0
- package/docs/walk.js.html +214 -0
- package/log4js.json +21 -0
- package/package.json +83 -0
- package/src/Formatter.js +66 -0
- package/src/FormatterFactory.js +41 -0
- package/src/Parser.js +53 -0
- package/src/ParserFactory.js +41 -0
- package/src/Plugin.js +99 -0
- package/src/PluginManager.js +56 -0
- package/src/Result.js +62 -0
- package/src/Rule.js +162 -0
- package/src/RuleSet.js +84 -0
- package/src/SourceFile.js +163 -0
- package/src/formatters/AnsiConsoleFormatter.js +78 -0
- package/src/index.js +213 -0
- package/src/plugins/XliffParser.js +60 -0
- package/src/plugins/XliffPlugin.js +60 -0
- package/src/rules/ResourceICUPlurals.js +229 -0
- package/src/rules/ResourceQuoteStyle.js +170 -0
- package/src/rules/ResourceRegExpChecker.js +179 -0
- package/src/rules/ResourceUniqueKeys.js +76 -0
- package/src/rules/utils.js +78 -0
- package/src/walk.js +146 -0
package/docs/Result.html
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Result - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnsiConsoleFormatter.html">AnsiConsoleFormatter</a><ul class='methods'><li data-type='method'><a href="AnsiConsoleFormatter.html#format">format</a></li><li data-type='method'><a href="AnsiConsoleFormatter.html#getDescription">getDescription</a></li></ul></li><li><a href="Formatter.html">Formatter</a><ul class='methods'><li data-type='method'><a href="Formatter.html#format">format</a></li><li data-type='method'><a href="Formatter.html#getDescription">getDescription</a></li><li data-type='method'><a href="Formatter.html#getName">getName</a></li></ul></li><li><a href="FormatterFactory.html">FormatterFactory</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getResources">getResources</a></li><li data-type='method'><a href="Parser.html#init">init</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li></ul></li><li><a href="Plugin.html">Plugin</a><ul class='methods'><li data-type='method'><a href="Plugin.html#getExtensions">getExtensions</a></li><li data-type='method'><a href="Plugin.html#getFormatters">getFormatters</a></li><li data-type='method'><a href="Plugin.html#getParsers">getParsers</a></li><li data-type='method'><a href="Plugin.html#getRules">getRules</a></li><li data-type='method'><a href="Plugin.html#getType">getType</a></li><li data-type='method'><a href="Plugin.html#init">init</a></li></ul></li><li><a href="PluginManager.html">PluginManager</a><ul class='methods'><li data-type='method'><a href="PluginManager.html#getHandlers">getHandlers</a></li><li data-type='method'><a href="PluginManager.html#load">load</a></li></ul></li><li><a href="ResourceICUPlurals.html">ResourceICUPlurals</a><ul class='methods'><li data-type='method'><a href="ResourceICUPlurals.html#match">match</a></li></ul></li><li><a href="ResourceQuoteStyle.html">ResourceQuoteStyle</a><ul class='methods'><li data-type='method'><a href="ResourceQuoteStyle.html#match">match</a></li></ul></li><li><a href="ResourceRegExpChecker.html">ResourceRegExpChecker</a><ul class='methods'><li data-type='method'><a href="ResourceRegExpChecker.html#match">match</a></li></ul></li><li><a href="ResourceUniqueKeys.html">ResourceUniqueKeys</a><ul class='methods'><li data-type='method'><a href="ResourceUniqueKeys.html#match">match</a></li></ul></li><li><a href="Result.html">Result</a></li><li><a href="Rule.html">Rule</a><ul class='methods'><li data-type='method'><a href="Rule.html#getDescription">getDescription</a></li><li data-type='method'><a href="Rule.html#getName">getName</a></li><li data-type='method'><a href="Rule.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="Rule.html#match">match</a></li></ul></li><li><a href="RuleSet.html">RuleSet</a><ul class='methods'><li data-type='method'><a href="RuleSet.html#addRule">addRule</a></li><li data-type='method'><a href="RuleSet.html#getRule">getRule</a></li><li data-type='method'><a href="RuleSet.html#getRules">getRules</a></li><li data-type='method'><a href="RuleSet.html#getSize">getSize</a></li></ul></li><li><a href="SourceFile.html">SourceFile</a><ul class='methods'><li data-type='method'><a href="SourceFile.html#findIssues">findIssues</a></li><li data-type='method'><a href="SourceFile.html#getFilePath">getFilePath</a></li><li data-type='method'><a href="SourceFile.html#getLocaleFromPath">getLocaleFromPath</a></li><li data-type='method'><a href="SourceFile.html#getType">getType</a></li><li data-type='method'><a href="SourceFile.html#parse">parse</a></li></ul></li><li><a href="XliffParser.html">XliffParser</a><ul class='methods'><li data-type='method'><a href="XliffParser.html#getResources">getResources</a></li><li data-type='method'><a href="XliffParser.html#parse">parse</a></li></ul></li><li><a href="XliffPlugin.html">XliffPlugin</a><ul class='methods'><li data-type='method'><a href="XliffPlugin.html#getExtensions">getExtensions</a></li><li data-type='method'><a href="XliffPlugin.html#getParsers">getParsers</a></li><li data-type='method'><a href="XliffPlugin.html#getType">getType</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#ParserFactory">ParserFactory</a></li><li><a href="global.html#walk">walk</a></li></ul>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">Result</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
|
|
45
|
+
<header>
|
|
46
|
+
|
|
47
|
+
<h2>
|
|
48
|
+
Result
|
|
49
|
+
</h2>
|
|
50
|
+
|
|
51
|
+
<div class="class-description usertext">Represent an ilib-lint rule check result</div>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</header>
|
|
55
|
+
|
|
56
|
+
<article>
|
|
57
|
+
|
|
58
|
+
<div class="container-overview">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<h2>Constructor</h2>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<h4 class="name" id="Result"><span class="type-signature">(abstract) </span>new Result<span class="signature">(fields)</span><span class="type-signature"></span></h4>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<dl class="details">
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<dt class="tag-source">Source:</dt>
|
|
77
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
78
|
+
<a href="Result.js.html">Result.js</a>, <a href="Result.js.html#line24">line 24</a>
|
|
79
|
+
</li></ul></dd>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</dl>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<div class="description usertext">
|
|
118
|
+
Construct an ilib-lint rule check result. Rules should return this
|
|
119
|
+
type when reporting issues in the source files. The fields can
|
|
120
|
+
contain any of the following properties:
|
|
121
|
+
|
|
122
|
+
- severity {String}: "warning" or "error" (required)
|
|
123
|
+
- description {String}: description of the problem in the source file
|
|
124
|
+
(required)
|
|
125
|
+
- pathName {String}: name of the file that the issue was found in (required)
|
|
126
|
+
- rule {Rule}: the rule that generated this issue (required)
|
|
127
|
+
- id {String}: key of a resource being checked
|
|
128
|
+
- source {String}: for resource problems, this is the original source string
|
|
129
|
+
- highlight {String}: highlighted text from the source file indicating
|
|
130
|
+
where the issue was. For resources, this is either the source or target
|
|
131
|
+
string, where-ever the problem occurred
|
|
132
|
+
- lineNumber {Number}: line number in the source fie where the issue
|
|
133
|
+
was found
|
|
134
|
+
- locale {String}: locale of associated with this issue
|
|
135
|
+
|
|
136
|
+
Only the severity, description, pathName, and rule are required. All other
|
|
137
|
+
properties are optional.
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<h5>Parameters:</h5>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
<table class="params">
|
|
154
|
+
<thead>
|
|
155
|
+
<tr>
|
|
156
|
+
|
|
157
|
+
<th>Name</th>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
<th>Type</th>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<th class="last">Description</th>
|
|
167
|
+
</tr>
|
|
168
|
+
</thead>
|
|
169
|
+
|
|
170
|
+
<tbody>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<tr>
|
|
174
|
+
|
|
175
|
+
<td class="name"><code>fields</code></td>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<td class="type">
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class="param-type">Object</span>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
</td>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<td class="description last">result fields</td>
|
|
192
|
+
</tr>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</tbody>
|
|
196
|
+
</table>
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</article>
|
|
240
|
+
|
|
241
|
+
</section>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<br class="clear">
|
|
251
|
+
|
|
252
|
+
<footer>
|
|
253
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon Dec 19 2022 15:00:46 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
254
|
+
</footer>
|
|
255
|
+
|
|
256
|
+
<script>prettyPrint();</script>
|
|
257
|
+
<script src="scripts/polyfill.js"></script>
|
|
258
|
+
<script src="scripts/linenumber.js"></script>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
</body>
|
|
263
|
+
</html>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Result.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnsiConsoleFormatter.html">AnsiConsoleFormatter</a><ul class='methods'><li data-type='method'><a href="AnsiConsoleFormatter.html#format">format</a></li><li data-type='method'><a href="AnsiConsoleFormatter.html#getDescription">getDescription</a></li></ul></li><li><a href="Formatter.html">Formatter</a><ul class='methods'><li data-type='method'><a href="Formatter.html#format">format</a></li><li data-type='method'><a href="Formatter.html#getDescription">getDescription</a></li><li data-type='method'><a href="Formatter.html#getName">getName</a></li></ul></li><li><a href="FormatterFactory.html">FormatterFactory</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getResources">getResources</a></li><li data-type='method'><a href="Parser.html#init">init</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li></ul></li><li><a href="Plugin.html">Plugin</a><ul class='methods'><li data-type='method'><a href="Plugin.html#getExtensions">getExtensions</a></li><li data-type='method'><a href="Plugin.html#getFormatters">getFormatters</a></li><li data-type='method'><a href="Plugin.html#getParsers">getParsers</a></li><li data-type='method'><a href="Plugin.html#getRules">getRules</a></li><li data-type='method'><a href="Plugin.html#getType">getType</a></li><li data-type='method'><a href="Plugin.html#init">init</a></li></ul></li><li><a href="PluginManager.html">PluginManager</a><ul class='methods'><li data-type='method'><a href="PluginManager.html#getHandlers">getHandlers</a></li><li data-type='method'><a href="PluginManager.html#load">load</a></li></ul></li><li><a href="ResourceICUPlurals.html">ResourceICUPlurals</a><ul class='methods'><li data-type='method'><a href="ResourceICUPlurals.html#match">match</a></li></ul></li><li><a href="ResourceQuoteStyle.html">ResourceQuoteStyle</a><ul class='methods'><li data-type='method'><a href="ResourceQuoteStyle.html#match">match</a></li></ul></li><li><a href="ResourceRegExpChecker.html">ResourceRegExpChecker</a><ul class='methods'><li data-type='method'><a href="ResourceRegExpChecker.html#match">match</a></li></ul></li><li><a href="ResourceUniqueKeys.html">ResourceUniqueKeys</a><ul class='methods'><li data-type='method'><a href="ResourceUniqueKeys.html#match">match</a></li></ul></li><li><a href="Result.html">Result</a></li><li><a href="Rule.html">Rule</a><ul class='methods'><li data-type='method'><a href="Rule.html#getDescription">getDescription</a></li><li data-type='method'><a href="Rule.html#getName">getName</a></li><li data-type='method'><a href="Rule.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="Rule.html#match">match</a></li></ul></li><li><a href="RuleSet.html">RuleSet</a><ul class='methods'><li data-type='method'><a href="RuleSet.html#addRule">addRule</a></li><li data-type='method'><a href="RuleSet.html#getRule">getRule</a></li><li data-type='method'><a href="RuleSet.html#getRules">getRules</a></li><li data-type='method'><a href="RuleSet.html#getSize">getSize</a></li></ul></li><li><a href="SourceFile.html">SourceFile</a><ul class='methods'><li data-type='method'><a href="SourceFile.html#findIssues">findIssues</a></li><li data-type='method'><a href="SourceFile.html#getFilePath">getFilePath</a></li><li data-type='method'><a href="SourceFile.html#getLocaleFromPath">getLocaleFromPath</a></li><li data-type='method'><a href="SourceFile.html#getType">getType</a></li><li data-type='method'><a href="SourceFile.html#parse">parse</a></li></ul></li><li><a href="XliffParser.html">XliffParser</a><ul class='methods'><li data-type='method'><a href="XliffParser.html#getResources">getResources</a></li><li data-type='method'><a href="XliffParser.html#parse">parse</a></li></ul></li><li><a href="XliffPlugin.html">XliffPlugin</a><ul class='methods'><li data-type='method'><a href="XliffPlugin.html#getExtensions">getExtensions</a></li><li data-type='method'><a href="XliffPlugin.html#getParsers">getParsers</a></li><li data-type='method'><a href="XliffPlugin.html#getType">getType</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#ParserFactory">ParserFactory</a></li><li><a href="global.html#walk">walk</a></li></ul>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">Result.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
|
+
<pre class="prettyprint source linenums"><code>/*
|
|
46
|
+
* Result.js - Represent an ilib-lint rule check result
|
|
47
|
+
*
|
|
48
|
+
* Copyright © 2022 JEDLSoft
|
|
49
|
+
*
|
|
50
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
* you may not use this file except in compliance with the License.
|
|
52
|
+
* You may obtain a copy of the License at
|
|
53
|
+
*
|
|
54
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
*
|
|
56
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
*
|
|
60
|
+
* See the License for the specific language governing permissions and
|
|
61
|
+
* limitations under the License.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @class Represent an ilib-lint rule check result
|
|
66
|
+
* @abstract
|
|
67
|
+
*/
|
|
68
|
+
class Result {
|
|
69
|
+
/**
|
|
70
|
+
* Construct an ilib-lint rule check result. Rules should return this
|
|
71
|
+
* type when reporting issues in the source files. The fields can
|
|
72
|
+
* contain any of the following properties:
|
|
73
|
+
*
|
|
74
|
+
* - severity {String}: "warning" or "error" (required)
|
|
75
|
+
* - description {String}: description of the problem in the source file
|
|
76
|
+
* (required)
|
|
77
|
+
* - pathName {String}: name of the file that the issue was found in (required)
|
|
78
|
+
* - rule {Rule}: the rule that generated this issue (required)
|
|
79
|
+
* - id {String}: key of a resource being checked
|
|
80
|
+
* - source {String}: for resource problems, this is the original source string
|
|
81
|
+
* - highlight {String}: highlighted text from the source file indicating
|
|
82
|
+
* where the issue was. For resources, this is either the source or target
|
|
83
|
+
* string, where-ever the problem occurred
|
|
84
|
+
* - lineNumber {Number}: line number in the source fie where the issue
|
|
85
|
+
* was found
|
|
86
|
+
* - locale {String}: locale of associated with this issue
|
|
87
|
+
*
|
|
88
|
+
* Only the severity, description, pathName, and rule are required. All other
|
|
89
|
+
* properties are optional.
|
|
90
|
+
*
|
|
91
|
+
* @param {Object} fields result fields
|
|
92
|
+
*/
|
|
93
|
+
constructor(fields) {
|
|
94
|
+
if (!fields || !fields.severity || !fields.description || !fields.pathName || !fields.rule) {
|
|
95
|
+
throw "Missing fields in Result constructor";
|
|
96
|
+
}
|
|
97
|
+
this.severity = (fields.severity === "error" || fields.severity === "warning") ?
|
|
98
|
+
fields.severity :
|
|
99
|
+
"warning";
|
|
100
|
+
["description", "pathName", "rule", "id", "highlight", "lineNumber", "locale", "source"].forEach(property => {
|
|
101
|
+
if (fields[property]) this[property] = fields[property];
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default Result;</code></pre>
|
|
107
|
+
</article>
|
|
108
|
+
</section>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<br class="clear">
|
|
118
|
+
|
|
119
|
+
<footer>
|
|
120
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon Dec 19 2022 15:00:46 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
121
|
+
</footer>
|
|
122
|
+
|
|
123
|
+
<script>prettyPrint();</script>
|
|
124
|
+
<script src="scripts/polyfill.js"></script>
|
|
125
|
+
<script src="scripts/linenumber.js"></script>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</body>
|
|
130
|
+
</html>
|