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
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Plugin.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">Plugin.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
|
+
<pre class="prettyprint source linenums"><code>/*
|
|
46
|
+
* Plugin.js - common SPI that all plugins must implement
|
|
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 common SPI that all plugins must implement
|
|
66
|
+
* @abstract
|
|
67
|
+
*/
|
|
68
|
+
class Plugin {
|
|
69
|
+
/**
|
|
70
|
+
* Construct a new plugin.
|
|
71
|
+
*/
|
|
72
|
+
constructor(options) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Initialize the current plugin,
|
|
77
|
+
* @abstract
|
|
78
|
+
*/
|
|
79
|
+
init() {}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Return the type of this plugin. This can be one of the
|
|
83
|
+
* following:
|
|
84
|
+
*
|
|
85
|
+
* <ul>
|
|
86
|
+
* <li>rule - this plugin implements a new rules
|
|
87
|
+
* <li>parser - this plugin knows how to parse files more deeply
|
|
88
|
+
* than line-by-line
|
|
89
|
+
* <li>formatter - this plugin formats results for a particular
|
|
90
|
+
* type of output
|
|
91
|
+
* </ul>
|
|
92
|
+
*
|
|
93
|
+
* @returns {String} tells what type of plugin this is
|
|
94
|
+
* @abstract
|
|
95
|
+
*/
|
|
96
|
+
getType() {
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Return the list of extensions of the files that this parser handles.
|
|
101
|
+
* The extensions are listed without the dot. eg. ["json", "jsn"]
|
|
102
|
+
*
|
|
103
|
+
* @returns {Array.<String>} a list of file name extensions
|
|
104
|
+
*/
|
|
105
|
+
getExtensions() {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* For a "rule" type of plugin, this returns a list of Rule instances
|
|
111
|
+
* that this plugin implements.
|
|
112
|
+
*
|
|
113
|
+
* @returns {Array.<Rule>} list of Rule instances implemented by this
|
|
114
|
+
* plugin
|
|
115
|
+
*/
|
|
116
|
+
getRules() {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* For a "parser" type of plugin, this returns a list of Parser classes
|
|
122
|
+
* that this plugin implements.
|
|
123
|
+
*
|
|
124
|
+
* @returns {Array.<Parser>} list of Parser classes implemented by this
|
|
125
|
+
* plugin
|
|
126
|
+
*/
|
|
127
|
+
getParsers() {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* For a "formatter" type of plugin, this returns a list of Formatter
|
|
133
|
+
* instances that this plugin implements.
|
|
134
|
+
*
|
|
135
|
+
* @returns {Array.<Formatter>} list of Formatter instances implemented by this
|
|
136
|
+
* plugin
|
|
137
|
+
*/
|
|
138
|
+
getFormatters() {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default Plugin;
|
|
144
|
+
</code></pre>
|
|
145
|
+
</article>
|
|
146
|
+
</section>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<br class="clear">
|
|
156
|
+
|
|
157
|
+
<footer>
|
|
158
|
+
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.
|
|
159
|
+
</footer>
|
|
160
|
+
|
|
161
|
+
<script>prettyPrint();</script>
|
|
162
|
+
<script src="scripts/polyfill.js"></script>
|
|
163
|
+
<script src="scripts/linenumber.js"></script>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
</body>
|
|
168
|
+
</html>
|