ilib-lint 1.1.0 → 1.2.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/README.md +31 -2
- package/docs/AnsiConsoleFormatter.html +1 -1
- package/docs/ConfigBasedFormatter.html +1 -1
- package/docs/DirItem.html +1 -1
- package/docs/DirItem.js.html +1 -1
- package/docs/FileType.html +1 -1
- package/docs/FileType.js.html +1 -1
- package/docs/FormatterManager.html +1 -1
- package/docs/FormatterManager.js.html +1 -1
- package/docs/ParserManager.html +1 -1
- package/docs/ParserManager.js.html +1 -1
- package/docs/PluginManager.html +8 -8
- package/docs/PluginManager.js.html +5 -3
- package/docs/Project.html +1 -1
- package/docs/Project.js.html +1 -1
- package/docs/ResourceICUPlurals.html +2 -2
- package/docs/ResourceMatcher.html +1 -1
- package/docs/ResourceQuoteStyle.html +2 -2
- package/docs/ResourceUniqueKeys.html +1 -1
- package/docs/RuleManager.html +1 -1
- package/docs/RuleManager.js.html +1 -1
- package/docs/RuleSet.html +1 -1
- package/docs/RuleSet.js.html +1 -1
- package/docs/SourceFile.html +1 -1
- package/docs/SourceFile.js.html +1 -1
- package/docs/XliffParser.html +1 -1
- package/docs/XliffPlugin.html +1 -1
- package/docs/formatters_AnsiConsoleFormatter.js.html +4 -1
- package/docs/formatters_ConfigBasedFormatter.js.html +8 -2
- package/docs/global.html +2 -2
- package/docs/index.html +1 -1
- package/docs/plugins_XliffParser.js.html +1 -1
- package/docs/plugins_XliffPlugin.js.html +1 -1
- package/docs/resource-icu-plurals.md +21 -0
- package/docs/resource-named-params.md +8 -0
- package/docs/resource-quote-style.md +21 -0
- package/docs/resource-unique-keys.md +6 -0
- package/docs/resource-url-match.md +7 -0
- package/docs/rules_ResourceICUPlurals.js.html +2 -1
- package/docs/rules_ResourceMatcher.js.html +2 -2
- package/docs/rules_ResourceQuoteStyle.js.html +2 -1
- package/docs/rules_ResourceSourceChecker.js.html +2 -2
- package/docs/rules_ResourceTargetChecker.js.html +2 -2
- package/docs/rules_ResourceUniqueKeys.js.html +2 -2
- package/docs/rules_SourceFileChecker.js.html +2 -2
- package/docs/walk.js.html +1 -1
- package/package.json +2 -2
- package/src/PluginManager.js +4 -2
- package/src/formatters/AnsiConsoleFormatter.js +3 -0
- package/src/formatters/ConfigBasedFormatter.js +7 -1
- package/src/rules/ResourceICUPlurals.js +1 -0
- package/src/rules/ResourceMatcher.js +1 -1
- package/src/rules/ResourceQuoteStyle.js +1 -0
- package/src/rules/ResourceSourceChecker.js +1 -1
- package/src/rules/ResourceTargetChecker.js +1 -1
- package/src/rules/ResourceUniqueKeys.js +1 -1
- package/src/rules/SourceFileChecker.js +1 -1
package/README.md
CHANGED
|
@@ -248,11 +248,12 @@ Here is an example of a configuration file:
|
|
|
248
248
|
"rules": [
|
|
249
249
|
// test that named parameters like {param} appear in both the source and target
|
|
250
250
|
{
|
|
251
|
-
"type": "resource-matcher",
|
|
252
251
|
"name": "resource-named-params",
|
|
252
|
+
"type": "resource-matcher",
|
|
253
253
|
"description": "Ensure that named parameters that appear in the source string are also used in the translated string",
|
|
254
254
|
"note": "The named parameter '{matchString}' from the source string does not appear in the target string",
|
|
255
|
-
"regexps": [ "\\{\\w+\\}" ]
|
|
255
|
+
"regexps": [ "\\{\\w+\\}" ],
|
|
256
|
+
"link": "https://github.com/ilib-js/i18nlint/blob/main/README.md"
|
|
256
257
|
}
|
|
257
258
|
],
|
|
258
259
|
"formatters": [
|
|
@@ -459,6 +460,11 @@ Each declarative rule should have the following properties:
|
|
|
459
460
|
in the source and target strings. If any one of those expressions
|
|
460
461
|
matches in the source, but not the target, the rule will create
|
|
461
462
|
a Result that will be formatted for the user.
|
|
463
|
+
* link (String) - an URL to a website with a more complete explanation
|
|
464
|
+
of the problem that was found and how the problem can be resolved
|
|
465
|
+
and avoided in the future. Often, this is a link to a markdown file
|
|
466
|
+
in the docs folder on the github repo for the plugin, but it can be
|
|
467
|
+
any link you like.
|
|
462
468
|
|
|
463
469
|
Programmatic rules are used when the requirements for the rules are more complicated
|
|
464
470
|
than a simple regular expression string can handle. For example, a rule that checks
|
|
@@ -509,6 +515,22 @@ Declarative formatters are simply a template string where properties of the Resu
|
|
|
509
515
|
instances are formatted into it. These can be declared in the config file. (See the
|
|
510
516
|
example config file above.)
|
|
511
517
|
|
|
518
|
+
The template strings may have any of the following fields from the Result instance
|
|
519
|
+
in them:
|
|
520
|
+
|
|
521
|
+
- severity
|
|
522
|
+
- pathName
|
|
523
|
+
- lineNumber
|
|
524
|
+
- source
|
|
525
|
+
- highlight
|
|
526
|
+
- id
|
|
527
|
+
|
|
528
|
+
Additionally, they may have the following fields from the Rule instance in them:
|
|
529
|
+
|
|
530
|
+
- ruleDescription
|
|
531
|
+
- ruleName
|
|
532
|
+
- ruleLink
|
|
533
|
+
|
|
512
534
|
Programmatic formatters are used when the requirements for formatting are more complicated
|
|
513
535
|
than a simple template string can handle. For example, a CSV formatter would have to make
|
|
514
536
|
sure that fields in a CSV file are escaped properly to conform to CSV syntax, and would
|
|
@@ -521,6 +543,8 @@ The constructor of this class should define the following properties:
|
|
|
521
543
|
|
|
522
544
|
- `this.name` - a unique name for this formatter
|
|
523
545
|
- `this.description` - a description of this type of formatter to display to users
|
|
546
|
+
- `this.link` - (optional) a link to a web page that gives a more complete explanation
|
|
547
|
+
the the rule and how to resolve the problem it found
|
|
524
548
|
|
|
525
549
|
The formatter should also override and implement the
|
|
526
550
|
[format()](https://github.com/iLib-js/i18nlint-common/blob/main/src/Formatter.js) method,
|
|
@@ -563,6 +587,11 @@ limitations under the License.
|
|
|
563
587
|
|
|
564
588
|
## Release Notes
|
|
565
589
|
|
|
590
|
+
### v1.2.0
|
|
591
|
+
|
|
592
|
+
- added Rule links to give rule writers a way of giving a more complete explanation
|
|
593
|
+
of the rule and how to resolve the problem.
|
|
594
|
+
|
|
566
595
|
### v1.1.0
|
|
567
596
|
|
|
568
597
|
- added support for plugins
|
|
@@ -348,7 +348,7 @@ formatted string.</li></ul></dd>
|
|
|
348
348
|
<br class="clear">
|
|
349
349
|
|
|
350
350
|
<footer>
|
|
351
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
351
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
352
352
|
</footer>
|
|
353
353
|
|
|
354
354
|
<script>prettyPrint();</script>
|
|
@@ -355,7 +355,7 @@ formatted string.</li></ul></dd>
|
|
|
355
355
|
<br class="clear">
|
|
356
356
|
|
|
357
357
|
<footer>
|
|
358
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
358
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
359
359
|
</footer>
|
|
360
360
|
|
|
361
361
|
<script>prettyPrint();</script>
|
package/docs/DirItem.html
CHANGED
|
@@ -705,7 +705,7 @@ The options parameter can contain any of the following properties:
|
|
|
705
705
|
<br class="clear">
|
|
706
706
|
|
|
707
707
|
<footer>
|
|
708
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
708
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
709
709
|
</footer>
|
|
710
710
|
|
|
711
711
|
<script>prettyPrint();</script>
|
package/docs/DirItem.js.html
CHANGED
|
@@ -149,7 +149,7 @@ export default DirItem;
|
|
|
149
149
|
<br class="clear">
|
|
150
150
|
|
|
151
151
|
<footer>
|
|
152
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
152
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
153
153
|
</footer>
|
|
154
154
|
|
|
155
155
|
<script>prettyPrint();</script>
|
package/docs/FileType.html
CHANGED
|
@@ -480,7 +480,7 @@ all of the ruleset definitions
|
|
|
480
480
|
<br class="clear">
|
|
481
481
|
|
|
482
482
|
<footer>
|
|
483
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
483
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
484
484
|
</footer>
|
|
485
485
|
|
|
486
486
|
<script>prettyPrint();</script>
|
package/docs/FileType.js.html
CHANGED
|
@@ -202,7 +202,7 @@ export default FileType;</code></pre>
|
|
|
202
202
|
<br class="clear">
|
|
203
203
|
|
|
204
204
|
<footer>
|
|
205
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
205
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
206
206
|
</footer>
|
|
207
207
|
|
|
208
208
|
<script>prettyPrint();</script>
|
|
@@ -731,7 +731,7 @@ values are the formatter descriptions.</li></ul></dd>
|
|
|
731
731
|
<br class="clear">
|
|
732
732
|
|
|
733
733
|
<footer>
|
|
734
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
734
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
735
735
|
</footer>
|
|
736
736
|
|
|
737
737
|
<script>prettyPrint();</script>
|
|
@@ -182,7 +182,7 @@ export default FormatterManager;</code></pre>
|
|
|
182
182
|
<br class="clear">
|
|
183
183
|
|
|
184
184
|
<footer>
|
|
185
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
185
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
186
186
|
</footer>
|
|
187
187
|
|
|
188
188
|
<script>prettyPrint();</script>
|
package/docs/ParserManager.html
CHANGED
|
@@ -594,7 +594,7 @@ values are the parser descriptions.</li></ul></dd>
|
|
|
594
594
|
<br class="clear">
|
|
595
595
|
|
|
596
596
|
<footer>
|
|
597
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
597
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
598
598
|
</footer>
|
|
599
599
|
|
|
600
600
|
<script>prettyPrint();</script>
|
|
@@ -155,7 +155,7 @@ export default ParserManager;</code></pre>
|
|
|
155
155
|
<br class="clear">
|
|
156
156
|
|
|
157
157
|
<footer>
|
|
158
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
158
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
159
159
|
</footer>
|
|
160
160
|
|
|
161
161
|
<script>prettyPrint();</script>
|
package/docs/PluginManager.html
CHANGED
|
@@ -85,7 +85,7 @@ and then maintains references to them</div>
|
|
|
85
85
|
|
|
86
86
|
<dt class="tag-source">Source:</dt>
|
|
87
87
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
88
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
88
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line127">line 127</a>
|
|
89
89
|
</li></ul></dd>
|
|
90
90
|
|
|
91
91
|
|
|
@@ -191,7 +191,7 @@ and then maintains references to them</div>
|
|
|
191
191
|
|
|
192
192
|
<dt class="tag-source">Source:</dt>
|
|
193
193
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
194
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
194
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line211">line 211</a>
|
|
195
195
|
</li></ul></dd>
|
|
196
196
|
|
|
197
197
|
|
|
@@ -328,7 +328,7 @@ loaded from the plugins.</li></ul></dd>
|
|
|
328
328
|
|
|
329
329
|
<dt class="tag-source">Source:</dt>
|
|
330
330
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
331
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
331
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line180">line 180</a>
|
|
332
332
|
</li></ul></dd>
|
|
333
333
|
|
|
334
334
|
|
|
@@ -439,7 +439,7 @@ loaded from the plugins.</li></ul></dd>
|
|
|
439
439
|
|
|
440
440
|
<dt class="tag-source">Source:</dt>
|
|
441
441
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
442
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
442
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line168">line 168</a>
|
|
443
443
|
</li></ul></dd>
|
|
444
444
|
|
|
445
445
|
|
|
@@ -550,7 +550,7 @@ loaded from the plugins.</li></ul></dd>
|
|
|
550
550
|
|
|
551
551
|
<dt class="tag-source">Source:</dt>
|
|
552
552
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
553
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
553
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line192">line 192</a>
|
|
554
554
|
</li></ul></dd>
|
|
555
555
|
|
|
556
556
|
|
|
@@ -660,7 +660,7 @@ built-in rules and the rules loaded from the plugins.</li></ul></dd>
|
|
|
660
660
|
|
|
661
661
|
<dt class="tag-source">Source:</dt>
|
|
662
662
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
663
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
663
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line202">line 202</a>
|
|
664
664
|
</li></ul></dd>
|
|
665
665
|
|
|
666
666
|
|
|
@@ -770,7 +770,7 @@ each named plugin is loaded. This method returns Promise</li></ul></dd>
|
|
|
770
770
|
|
|
771
771
|
<dt class="tag-source">Source:</dt>
|
|
772
772
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
773
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
773
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line232">line 232</a>
|
|
774
774
|
</li></ul></dd>
|
|
775
775
|
|
|
776
776
|
|
|
@@ -930,7 +930,7 @@ each named plugin is loaded. This method returns Promise</li></ul></dd>
|
|
|
930
930
|
<br class="clear">
|
|
931
931
|
|
|
932
932
|
<footer>
|
|
933
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
933
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
934
934
|
</footer>
|
|
935
935
|
|
|
936
936
|
<script>prettyPrint();</script>
|
|
@@ -86,14 +86,16 @@ export const regexRules = [
|
|
|
86
86
|
name: "resource-url-match",
|
|
87
87
|
description: "Ensure that URLs that appear in the source string are also used in the translated string",
|
|
88
88
|
note: "URL '{matchString}' from the source string does not appear in the target string",
|
|
89
|
-
regexps: [ "((https?|github|ftps?|mailto|file|data|irc):\\/\\/)([\\da-zA-Z\\.-]+)\\.([a-zA-Z\\.]{2,6})([\\/\w\\.-]*)*\\/?" ]
|
|
89
|
+
regexps: [ "((https?|github|ftps?|mailto|file|data|irc):\\/\\/)([\\da-zA-Z\\.-]+)\\.([a-zA-Z\\.]{2,6})([\\/\w\\.-]*)*\\/?" ],
|
|
90
|
+
link: "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-url-match.md"
|
|
90
91
|
},
|
|
91
92
|
{
|
|
92
93
|
type: "resource-matcher",
|
|
93
94
|
name: "resource-named-params",
|
|
94
95
|
description: "Ensure that named parameters that appear in the source string are also used in the translated string",
|
|
95
96
|
note: "The named parameter '{matchString}' from the source string does not appear in the target string",
|
|
96
|
-
regexps: [ "\\{\\w+\\}" ]
|
|
97
|
+
regexps: [ "\\{\\w+\\}" ],
|
|
98
|
+
link: "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-named-params.md"
|
|
97
99
|
}
|
|
98
100
|
];
|
|
99
101
|
|
|
@@ -302,7 +304,7 @@ export default PluginManager;
|
|
|
302
304
|
<br class="clear">
|
|
303
305
|
|
|
304
306
|
<footer>
|
|
305
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
307
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
306
308
|
</footer>
|
|
307
309
|
|
|
308
310
|
<script>prettyPrint();</script>
|
package/docs/Project.html
CHANGED
|
@@ -2056,7 +2056,7 @@ plugins and initializes them.</li></ul></dd>
|
|
|
2056
2056
|
<br class="clear">
|
|
2057
2057
|
|
|
2058
2058
|
<footer>
|
|
2059
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
2059
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
2060
2060
|
</footer>
|
|
2061
2061
|
|
|
2062
2062
|
<script>prettyPrint();</script>
|
package/docs/Project.js.html
CHANGED
|
@@ -387,7 +387,7 @@ export default Project;
|
|
|
387
387
|
<br class="clear">
|
|
388
388
|
|
|
389
389
|
<footer>
|
|
390
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
390
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
391
391
|
</footer>
|
|
392
392
|
|
|
393
393
|
<script>prettyPrint();</script>
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
|
|
188
188
|
<dt class="tag-source">Source:</dt>
|
|
189
189
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
190
|
-
<a href="rules_ResourceICUPlurals.js.html">rules/ResourceICUPlurals.js</a>, <a href="rules_ResourceICUPlurals.js.html#
|
|
190
|
+
<a href="rules_ResourceICUPlurals.js.html">rules/ResourceICUPlurals.js</a>, <a href="rules_ResourceICUPlurals.js.html#line189">line 189</a>
|
|
191
191
|
</li></ul></dd>
|
|
192
192
|
|
|
193
193
|
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
<br class="clear">
|
|
272
272
|
|
|
273
273
|
<footer>
|
|
274
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
274
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
275
275
|
</footer>
|
|
276
276
|
|
|
277
277
|
<script>prettyPrint();</script>
|
|
@@ -2179,7 +2179,7 @@ The options must contain the following required properties:
|
|
|
2179
2179
|
<br class="clear">
|
|
2180
2180
|
|
|
2181
2181
|
<footer>
|
|
2182
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
2182
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
2183
2183
|
</footer>
|
|
2184
2184
|
|
|
2185
2185
|
<script>prettyPrint();</script>
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
|
|
188
188
|
<dt class="tag-source">Source:</dt>
|
|
189
189
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
190
|
-
<a href="rules_ResourceQuoteStyle.js.html">rules/ResourceQuoteStyle.js</a>, <a href="rules_ResourceQuoteStyle.js.html#
|
|
190
|
+
<a href="rules_ResourceQuoteStyle.js.html">rules/ResourceQuoteStyle.js</a>, <a href="rules_ResourceQuoteStyle.js.html#line55">line 55</a>
|
|
191
191
|
</li></ul></dd>
|
|
192
192
|
|
|
193
193
|
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
<br class="clear">
|
|
272
272
|
|
|
273
273
|
<footer>
|
|
274
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
274
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
275
275
|
</footer>
|
|
276
276
|
|
|
277
277
|
<script>prettyPrint();</script>
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
<br class="clear">
|
|
322
322
|
|
|
323
323
|
<footer>
|
|
324
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
324
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
325
325
|
</footer>
|
|
326
326
|
|
|
327
327
|
<script>prettyPrint();</script>
|
package/docs/RuleManager.html
CHANGED
|
@@ -1579,7 +1579,7 @@ known by this instance of the rule manager.</li></ul></dd>
|
|
|
1579
1579
|
<br class="clear">
|
|
1580
1580
|
|
|
1581
1581
|
<footer>
|
|
1582
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
1582
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
1583
1583
|
</footer>
|
|
1584
1584
|
|
|
1585
1585
|
<script>prettyPrint();</script>
|
package/docs/RuleManager.js.html
CHANGED
|
@@ -339,7 +339,7 @@ export default RuleManager;</code></pre>
|
|
|
339
339
|
<br class="clear">
|
|
340
340
|
|
|
341
341
|
<footer>
|
|
342
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
342
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
343
343
|
</footer>
|
|
344
344
|
|
|
345
345
|
<script>prettyPrint();</script>
|
package/docs/RuleSet.html
CHANGED
|
@@ -943,7 +943,7 @@ all rules are returned.</td>
|
|
|
943
943
|
<br class="clear">
|
|
944
944
|
|
|
945
945
|
<footer>
|
|
946
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
946
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
947
947
|
</footer>
|
|
948
948
|
|
|
949
949
|
<script>prettyPrint();</script>
|
package/docs/RuleSet.js.html
CHANGED
|
@@ -157,7 +157,7 @@ export default RuleSet;
|
|
|
157
157
|
<br class="clear">
|
|
158
158
|
|
|
159
159
|
<footer>
|
|
160
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
160
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
161
161
|
</footer>
|
|
162
162
|
|
|
163
163
|
<script>prettyPrint();</script>
|
package/docs/SourceFile.html
CHANGED
|
@@ -719,7 +719,7 @@ resource files, or lines in the case of other types of files.</li></ul></dd>
|
|
|
719
719
|
<br class="clear">
|
|
720
720
|
|
|
721
721
|
<footer>
|
|
722
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
722
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
723
723
|
</footer>
|
|
724
724
|
|
|
725
725
|
<script>prettyPrint();</script>
|
package/docs/SourceFile.js.html
CHANGED
|
@@ -211,7 +211,7 @@ export default SourceFile;
|
|
|
211
211
|
<br class="clear">
|
|
212
212
|
|
|
213
213
|
<footer>
|
|
214
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
214
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
215
215
|
</footer>
|
|
216
216
|
|
|
217
217
|
<script>prettyPrint();</script>
|
package/docs/XliffParser.html
CHANGED
|
@@ -383,7 +383,7 @@ that result from parsing the file.</li></ul></dd>
|
|
|
383
383
|
<br class="clear">
|
|
384
384
|
|
|
385
385
|
<footer>
|
|
386
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
386
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
387
387
|
</footer>
|
|
388
388
|
|
|
389
389
|
<script>prettyPrint();</script>
|
package/docs/XliffPlugin.html
CHANGED
|
@@ -299,7 +299,7 @@ plugin
|
|
|
299
299
|
<br class="clear">
|
|
300
300
|
|
|
301
301
|
<footer>
|
|
302
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
302
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
303
303
|
</footer>
|
|
304
304
|
|
|
305
305
|
<script>prettyPrint();</script>
|
|
@@ -109,6 +109,9 @@ class AnsiConsoleFormatter extends Formatter {
|
|
|
109
109
|
output = output.replace(/<e\d><\/e\d>/g, "\u001B[91m \u001B[0m");
|
|
110
110
|
output = output.replace(/<e\d>/g, "\u001B[91m");
|
|
111
111
|
output = output.replace(/<\/e\d>/g, "\u001B[0m");
|
|
112
|
+
if (typeof(result.rule.getLink) === 'function' && result.rule.getLink()) {
|
|
113
|
+
output += ` More info: ${result.rule.getLink()}\n`;
|
|
114
|
+
}
|
|
112
115
|
return output;
|
|
113
116
|
}
|
|
114
117
|
}
|
|
@@ -128,7 +131,7 @@ export default AnsiConsoleFormatter;
|
|
|
128
131
|
<br class="clear">
|
|
129
132
|
|
|
130
133
|
<footer>
|
|
131
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
134
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
132
135
|
</footer>
|
|
133
136
|
|
|
134
137
|
<script>prettyPrint();</script>
|
|
@@ -122,7 +122,7 @@ export class ConfigBasedFormatter extends Formatter {
|
|
|
122
122
|
let output = this.template;
|
|
123
123
|
|
|
124
124
|
for (let prop of resultFields) {
|
|
125
|
-
output = output.replace(new RegExp(`{${prop}}`, "g"), result[prop]);
|
|
125
|
+
output = output.replace(new RegExp(`{${prop}}`, "g"), result[prop] || "");
|
|
126
126
|
}
|
|
127
127
|
output = output.replace(new RegExp("{ruleName}", "g"), result.rule.getName());
|
|
128
128
|
output = output.replace(new RegExp("{ruleDescription}", "g"), result.rule.getDescription());
|
|
@@ -130,6 +130,12 @@ export class ConfigBasedFormatter extends Formatter {
|
|
|
130
130
|
output = output.replace(/<e\d><\/e\d>/g, `${this.highlightStart}${this.highlightEnd}`);
|
|
131
131
|
output = output.replace(/<e\d>/g, this.highlightStart);
|
|
132
132
|
output = output.replace(/<\/e\d>/g, this.highlightEnd);
|
|
133
|
+
|
|
134
|
+
let link = "";
|
|
135
|
+
if (typeof(result.rule.getLink) === 'function') {
|
|
136
|
+
link = result.rule.getLink() || "";
|
|
137
|
+
}
|
|
138
|
+
output = output.replace(new RegExp("{ruleLink}", "g"), link);
|
|
133
139
|
return output;
|
|
134
140
|
}
|
|
135
141
|
}
|
|
@@ -147,7 +153,7 @@ export class ConfigBasedFormatter extends Formatter {
|
|
|
147
153
|
<br class="clear">
|
|
148
154
|
|
|
149
155
|
<footer>
|
|
150
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
156
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
151
157
|
</footer>
|
|
152
158
|
|
|
153
159
|
<script>prettyPrint();</script>
|
package/docs/global.html
CHANGED
|
@@ -147,7 +147,7 @@ the regular i18nlint stream.</li></ul></dd>
|
|
|
147
147
|
|
|
148
148
|
<dt class="tag-source">Source:</dt>
|
|
149
149
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
150
|
-
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#
|
|
150
|
+
<a href="PluginManager.js.html">PluginManager.js</a>, <a href="PluginManager.js.html#line117">line 117</a>
|
|
151
151
|
</li></ul></dd>
|
|
152
152
|
|
|
153
153
|
|
|
@@ -511,7 +511,7 @@ by the the excludes and includes list
|
|
|
511
511
|
<br class="clear">
|
|
512
512
|
|
|
513
513
|
<footer>
|
|
514
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
514
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
515
515
|
</footer>
|
|
516
516
|
|
|
517
517
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<br class="clear">
|
|
72
72
|
|
|
73
73
|
<footer>
|
|
74
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
75
75
|
</footer>
|
|
76
76
|
|
|
77
77
|
<script>prettyPrint();</script>
|
|
@@ -126,7 +126,7 @@ export default XliffParser;
|
|
|
126
126
|
<br class="clear">
|
|
127
127
|
|
|
128
128
|
<footer>
|
|
129
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
129
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
130
130
|
</footer>
|
|
131
131
|
|
|
132
132
|
<script>prettyPrint();</script>
|
|
@@ -106,7 +106,7 @@ export default XliffPlugin;
|
|
|
106
106
|
<br class="clear">
|
|
107
107
|
|
|
108
108
|
<footer>
|
|
109
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
109
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
110
110
|
</footer>
|
|
111
111
|
|
|
112
112
|
<script>prettyPrint();</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# resource-icu-plurals
|
|
2
|
+
|
|
3
|
+
If you received this error, then there is a syntax error in your plural string in
|
|
4
|
+
the source String or in the translation string. Strings are expected to follow the
|
|
5
|
+
ICU format plurals. More info can be found [here](https://formatjs.io/docs/core-concepts/icu-syntax/#plural-format).
|
|
6
|
+
|
|
7
|
+
There may be multiple types of errors:
|
|
8
|
+
|
|
9
|
+
- The source contains a plural, but the translation does not. Obviously, you need
|
|
10
|
+
to ask the translator to put in the correct plural.
|
|
11
|
+
- The translation contains a plural, but it is not in the right syntax. Make sure
|
|
12
|
+
it follows the syntax as per above.
|
|
13
|
+
- The translation contains a plural and it is in the right syntax, but it has the
|
|
14
|
+
wrong categories. Each locale uses a different set of categories of plurals. For
|
|
15
|
+
example, Russian uses "one", "few", and "other", whereas Japanese only uses
|
|
16
|
+
"other". The translator should know which categories their language uses and add
|
|
17
|
+
the appropriate categories to the plural or subtract the ones that are not
|
|
18
|
+
needed.
|
|
19
|
+
- The translation contains a plural in the right syntax, but it uses plural categories
|
|
20
|
+
that the target locale does not need. In this case, simply remove the unneeded
|
|
21
|
+
plural category translation.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# resource-named-params
|
|
2
|
+
|
|
3
|
+
Ensure that named parameters that appear in the source string are also used in the
|
|
4
|
+
translated string. Named parameters have the syntax {name}. That is, they are a
|
|
5
|
+
simple name surrounded by curly braces. The same parameter must also exist in the
|
|
6
|
+
target string with the same name. Sometimes translators accidentally translate
|
|
7
|
+
the name of the parameter. Also, if the target string contains a parameter that
|
|
8
|
+
the source string does not, you will also get this error.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# resource-quote-style
|
|
2
|
+
|
|
3
|
+
If you received this error in your project, that means that a string was found where:
|
|
4
|
+
|
|
5
|
+
- the source string contains quotes
|
|
6
|
+
- the target string does not contain quotes or the quotes are not correct for the
|
|
7
|
+
target locale
|
|
8
|
+
|
|
9
|
+
Try adding quotes around the translation of the part of the source string that was
|
|
10
|
+
quoted, or adjusting the quotes in the target string to be appropriate for the target
|
|
11
|
+
locale.
|
|
12
|
+
|
|
13
|
+
Example string with a problem:
|
|
14
|
+
|
|
15
|
+
source in English: This is a “string” in English.
|
|
16
|
+
target in German: Dies ist eine "Zeichenfolge" auf deutsch.
|
|
17
|
+
|
|
18
|
+
This would be flagged because the target is using the ASCII quotes instead of the
|
|
19
|
+
proper quotes in German. The correct proper quotes would look like this:
|
|
20
|
+
|
|
21
|
+
target: Dies ist eine „Zeichenfolge“ auf deutsch.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# resource-unique-keys
|
|
2
|
+
|
|
3
|
+
If you received this error, it means that there are multiple resources in your project
|
|
4
|
+
that have the same unique key, making them not actually unique. To resolve this,
|
|
5
|
+
try changing the unique key for one of the instances so that they are both actually
|
|
6
|
+
unique.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# resource-url-match
|
|
2
|
+
|
|
3
|
+
Ensure that URLs that appear in the source string are also used in the translated string.
|
|
4
|
+
This rule checks the source string for anything that matches an URL. If found, the same
|
|
5
|
+
URL must appear in the translation of the string as well. In some cases, you may want a
|
|
6
|
+
different URL in the translation. In that case, this rule should be turned off for that
|
|
7
|
+
string.
|
|
@@ -108,6 +108,7 @@ class ResourceICUPlurals extends Rule {
|
|
|
108
108
|
this.name = "resource-icu-plurals";
|
|
109
109
|
this.description = "Ensure that plurals in translated resources have the correct syntax";
|
|
110
110
|
this.sourceLocale = (options && options.sourceLocale) || "en-US";
|
|
111
|
+
this.link = "https://gihub.com/ilib-js/i18nlint/blob/main/docs/resource-icu-plurals.md";
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
getRuleType() {
|
|
@@ -289,7 +290,7 @@ export default ResourceICUPlurals;</code></pre>
|
|
|
289
290
|
<br class="clear">
|
|
290
291
|
|
|
291
292
|
<footer>
|
|
292
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
293
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
293
294
|
</footer>
|
|
294
295
|
|
|
295
296
|
<script>prettyPrint();</script>
|
|
@@ -107,7 +107,7 @@ class ResourceMatcher extends Rule {
|
|
|
107
107
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
108
108
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
109
109
|
}
|
|
110
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
110
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
111
111
|
this[prop] = options[prop];
|
|
112
112
|
});
|
|
113
113
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -240,7 +240,7 @@ export default ResourceMatcher;
|
|
|
240
240
|
<br class="clear">
|
|
241
241
|
|
|
242
242
|
<footer>
|
|
243
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
243
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
244
244
|
</footer>
|
|
245
245
|
|
|
246
246
|
<script>prettyPrint();</script>
|
|
@@ -89,6 +89,7 @@ class ResourceQuoteStyle extends Rule {
|
|
|
89
89
|
// only localized quotes are allowed in the target string
|
|
90
90
|
this.localeOnly = true;
|
|
91
91
|
}
|
|
92
|
+
this.link = "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-quote-style.md";
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
getRuleType() {
|
|
@@ -236,7 +237,7 @@ export default ResourceQuoteStyle;</code></pre>
|
|
|
236
237
|
<br class="clear">
|
|
237
238
|
|
|
238
239
|
<footer>
|
|
239
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
240
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
240
241
|
</footer>
|
|
241
242
|
|
|
242
243
|
<script>prettyPrint();</script>
|
|
@@ -106,7 +106,7 @@ class ResourceMatcher extends Rule {
|
|
|
106
106
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
107
107
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
108
108
|
}
|
|
109
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
109
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
110
110
|
this[prop] = options[prop];
|
|
111
111
|
});
|
|
112
112
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -239,7 +239,7 @@ export default ResourceMatcher;
|
|
|
239
239
|
<br class="clear">
|
|
240
240
|
|
|
241
241
|
<footer>
|
|
242
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
242
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
243
243
|
</footer>
|
|
244
244
|
|
|
245
245
|
<script>prettyPrint();</script>
|
|
@@ -106,7 +106,7 @@ class ResourceMatcher extends Rule {
|
|
|
106
106
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
107
107
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
108
108
|
}
|
|
109
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
109
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
110
110
|
this[prop] = options[prop];
|
|
111
111
|
});
|
|
112
112
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -239,7 +239,7 @@ export default ResourceMatcher;
|
|
|
239
239
|
<br class="clear">
|
|
240
240
|
|
|
241
241
|
<footer>
|
|
242
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
242
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
243
243
|
</footer>
|
|
244
244
|
|
|
245
245
|
<script>prettyPrint();</script>
|
|
@@ -83,7 +83,7 @@ class ResourceUniqueKeys extends Rule {
|
|
|
83
83
|
this.name = "resource-unique-keys";
|
|
84
84
|
this.description = "Ensure that the keys are unique within a locale across all resource files";
|
|
85
85
|
this.sourceLocale = (options && options.sourceLocale) || "en-US";
|
|
86
|
-
|
|
86
|
+
this.link = "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-unique-keys.md";
|
|
87
87
|
this.ts = new TranslationSet();
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -138,7 +138,7 @@ export default ResourceUniqueKeys;</code></pre>
|
|
|
138
138
|
<br class="clear">
|
|
139
139
|
|
|
140
140
|
<footer>
|
|
141
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
141
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
142
142
|
</footer>
|
|
143
143
|
|
|
144
144
|
<script>prettyPrint();</script>
|
|
@@ -106,7 +106,7 @@ class ResourceMatcher extends Rule {
|
|
|
106
106
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
107
107
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
108
108
|
}
|
|
109
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
109
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
110
110
|
this[prop] = options[prop];
|
|
111
111
|
});
|
|
112
112
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -239,7 +239,7 @@ export default ResourceMatcher;
|
|
|
239
239
|
<br class="clear">
|
|
240
240
|
|
|
241
241
|
<footer>
|
|
242
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
242
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
243
243
|
</footer>
|
|
244
244
|
|
|
245
245
|
<script>prettyPrint();</script>
|
package/docs/walk.js.html
CHANGED
|
@@ -213,7 +213,7 @@ export default walk;</code></pre>
|
|
|
213
213
|
<br class="clear">
|
|
214
214
|
|
|
215
215
|
<footer>
|
|
216
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on
|
|
216
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.0</a> on Mon Feb 06 2023 10:29:33 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
217
217
|
</footer>
|
|
218
218
|
|
|
219
219
|
<script>prettyPrint();</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ilib-lint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"module": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./src/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@formatjs/intl": "^2.6.3",
|
|
74
|
-
"i18nlint-common": "^1.
|
|
74
|
+
"i18nlint-common": "^1.3.0",
|
|
75
75
|
"ilib-common": "^1.1.3",
|
|
76
76
|
"ilib-lint-plugin-test": "file:test/ilib-lint-plugin-test",
|
|
77
77
|
"ilib-locale": "^1.2.2",
|
package/src/PluginManager.js
CHANGED
|
@@ -39,14 +39,16 @@ export const regexRules = [
|
|
|
39
39
|
name: "resource-url-match",
|
|
40
40
|
description: "Ensure that URLs that appear in the source string are also used in the translated string",
|
|
41
41
|
note: "URL '{matchString}' from the source string does not appear in the target string",
|
|
42
|
-
regexps: [ "((https?|github|ftps?|mailto|file|data|irc):\\/\\/)([\\da-zA-Z\\.-]+)\\.([a-zA-Z\\.]{2,6})([\\/\w\\.-]*)*\\/?" ]
|
|
42
|
+
regexps: [ "((https?|github|ftps?|mailto|file|data|irc):\\/\\/)([\\da-zA-Z\\.-]+)\\.([a-zA-Z\\.]{2,6})([\\/\w\\.-]*)*\\/?" ],
|
|
43
|
+
link: "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-url-match.md"
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
type: "resource-matcher",
|
|
46
47
|
name: "resource-named-params",
|
|
47
48
|
description: "Ensure that named parameters that appear in the source string are also used in the translated string",
|
|
48
49
|
note: "The named parameter '{matchString}' from the source string does not appear in the target string",
|
|
49
|
-
regexps: [ "\\{\\w+\\}" ]
|
|
50
|
+
regexps: [ "\\{\\w+\\}" ],
|
|
51
|
+
link: "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-named-params.md"
|
|
50
52
|
}
|
|
51
53
|
];
|
|
52
54
|
|
|
@@ -62,6 +62,9 @@ class AnsiConsoleFormatter extends Formatter {
|
|
|
62
62
|
output = output.replace(/<e\d><\/e\d>/g, "\u001B[91m \u001B[0m");
|
|
63
63
|
output = output.replace(/<e\d>/g, "\u001B[91m");
|
|
64
64
|
output = output.replace(/<\/e\d>/g, "\u001B[0m");
|
|
65
|
+
if (typeof(result.rule.getLink) === 'function' && result.rule.getLink()) {
|
|
66
|
+
output += ` More info: ${result.rule.getLink()}\n`;
|
|
67
|
+
}
|
|
65
68
|
return output;
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -75,7 +75,7 @@ export class ConfigBasedFormatter extends Formatter {
|
|
|
75
75
|
let output = this.template;
|
|
76
76
|
|
|
77
77
|
for (let prop of resultFields) {
|
|
78
|
-
output = output.replace(new RegExp(`{${prop}}`, "g"), result[prop]);
|
|
78
|
+
output = output.replace(new RegExp(`{${prop}}`, "g"), result[prop] || "");
|
|
79
79
|
}
|
|
80
80
|
output = output.replace(new RegExp("{ruleName}", "g"), result.rule.getName());
|
|
81
81
|
output = output.replace(new RegExp("{ruleDescription}", "g"), result.rule.getDescription());
|
|
@@ -83,6 +83,12 @@ export class ConfigBasedFormatter extends Formatter {
|
|
|
83
83
|
output = output.replace(/<e\d><\/e\d>/g, `${this.highlightStart}${this.highlightEnd}`);
|
|
84
84
|
output = output.replace(/<e\d>/g, this.highlightStart);
|
|
85
85
|
output = output.replace(/<\/e\d>/g, this.highlightEnd);
|
|
86
|
+
|
|
87
|
+
let link = "";
|
|
88
|
+
if (typeof(result.rule.getLink) === 'function') {
|
|
89
|
+
link = result.rule.getLink() || "";
|
|
90
|
+
}
|
|
91
|
+
output = output.replace(new RegExp("{ruleLink}", "g"), link);
|
|
86
92
|
return output;
|
|
87
93
|
}
|
|
88
94
|
}
|
|
@@ -61,6 +61,7 @@ class ResourceICUPlurals extends Rule {
|
|
|
61
61
|
this.name = "resource-icu-plurals";
|
|
62
62
|
this.description = "Ensure that plurals in translated resources have the correct syntax";
|
|
63
63
|
this.sourceLocale = (options && options.sourceLocale) || "en-US";
|
|
64
|
+
this.link = "https://gihub.com/ilib-js/i18nlint/blob/main/docs/resource-icu-plurals.md";
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
getRuleType() {
|
|
@@ -60,7 +60,7 @@ class ResourceMatcher extends Rule {
|
|
|
60
60
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
61
61
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
62
62
|
}
|
|
63
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
63
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
64
64
|
this[prop] = options[prop];
|
|
65
65
|
});
|
|
66
66
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -59,7 +59,7 @@ class ResourceMatcher extends Rule {
|
|
|
59
59
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
60
60
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
61
61
|
}
|
|
62
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
62
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
63
63
|
this[prop] = options[prop];
|
|
64
64
|
});
|
|
65
65
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -59,7 +59,7 @@ class ResourceMatcher extends Rule {
|
|
|
59
59
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
60
60
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
61
61
|
}
|
|
62
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
62
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
63
63
|
this[prop] = options[prop];
|
|
64
64
|
});
|
|
65
65
|
this.sourceLocale = this.sourceLocale || "en-US";
|
|
@@ -36,7 +36,7 @@ class ResourceUniqueKeys extends Rule {
|
|
|
36
36
|
this.name = "resource-unique-keys";
|
|
37
37
|
this.description = "Ensure that the keys are unique within a locale across all resource files";
|
|
38
38
|
this.sourceLocale = (options && options.sourceLocale) || "en-US";
|
|
39
|
-
|
|
39
|
+
this.link = "https://github.com/ilib-js/i18nlint/blob/main/docs/resource-unique-keys.md";
|
|
40
40
|
this.ts = new TranslationSet();
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -59,7 +59,7 @@ class ResourceMatcher extends Rule {
|
|
|
59
59
|
if (!options || !options.name || !options.description || !options.note || !options.regexps) {
|
|
60
60
|
throw "Missing required options for the ResourceMatcher constructor";
|
|
61
61
|
}
|
|
62
|
-
["name", "description", "regexps", "note", "sourceLocale"].forEach(prop => {
|
|
62
|
+
["name", "description", "regexps", "note", "sourceLocale", "link"].forEach(prop => {
|
|
63
63
|
this[prop] = options[prop];
|
|
64
64
|
});
|
|
65
65
|
this.sourceLocale = this.sourceLocale || "en-US";
|