@sap/eslint-plugin-cds 2.2.1 → 2.2.2
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/CHANGELOG.md +39 -0
- package/lib/api/formatter.js +165 -166
- package/lib/api/index.js +10 -5
- package/lib/impl/constants.js +3 -6
- package/lib/impl/processor.js +3 -3
- package/lib/impl/ruleFactory.js +290 -298
- package/lib/impl/rules/assoc2many-ambiguous-key.js +27 -9
- package/lib/impl/rules/latest-cds-version.js +4 -5
- package/lib/impl/rules/min-node-version.js +0 -1
- package/lib/impl/rules/no-db-keywords.js +25 -15
- package/lib/impl/rules/no-join-on-draft-enabled-entities.js +35 -0
- package/lib/impl/rules/require-2many-oncond.js +1 -1
- package/lib/impl/rules/rule.hbs +15 -8
- package/lib/impl/rules/sql-cast-suggestion.js +4 -2
- package/lib/impl/rules/start-elements-lowercase.js +13 -5
- package/lib/impl/rules/start-entities-uppercase.js +13 -4
- package/lib/impl/utils/helpers.js +27 -48
- package/lib/impl/utils/model.js +524 -481
- package/lib/impl/utils/rules.js +44 -35
- package/lib/impl/utils/validate.js +14 -21
- package/package.json +1 -1
package/lib/impl/ruleFactory.js
CHANGED
|
@@ -9,10 +9,15 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Since we want to lint cds models without an AST, we adapted the context
|
|
11
11
|
* object to explicitly pass some additional information:
|
|
12
|
-
* - '
|
|
13
|
-
* - '
|
|
14
|
-
* - '
|
|
15
|
-
* - '
|
|
12
|
+
* - 'category' : Rule category
|
|
13
|
+
* - 'cds' : Proxy for cds object which also caches results
|
|
14
|
+
* - 'code' : Code object based on ESLint getFromSourceCode()
|
|
15
|
+
* - 'ruleID' : Rule ID ("@sap/cds/...")
|
|
16
|
+
* - 'filePath' : ESLint's 'physical' filename
|
|
17
|
+
* - 'options' : CDS Environment parameters
|
|
18
|
+
* - 'report' : Proxy for ESLint's context.report() for lint filtering
|
|
19
|
+
* - 'ruleID' : ESLint's rule ID
|
|
20
|
+
* - 'sourcecode': ESLint's SourceCode object
|
|
16
21
|
*
|
|
17
22
|
* @typedef { import('eslint').Rule.RuleModule } RuleModule
|
|
18
23
|
* @typedef { import('eslint').Rule.RuleContext } RuleContext
|
|
@@ -23,297 +28,284 @@
|
|
|
23
28
|
* @typedef { import("./types").CDSRuleTestOpts } CDSRuleTestOpts
|
|
24
29
|
*/
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (type === "invalid") {
|
|
308
|
-
testerCases[type][0].errors = options.errors;
|
|
309
|
-
const fileFixed = path.join(options.root, `fixed/${options.filename}`);
|
|
310
|
-
if (fs.existsSync(fileFixed)) {
|
|
311
|
-
testerCases[type][0].output = fs.readFileSync(fileFixed, "utf8");
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
return tester.run(rulename, rule, testerCases);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
module.exports = { createRule, defineRule, runRuleTester };
|
|
319
|
-
|
|
31
|
+
const fs = require("fs");
|
|
32
|
+
const path = require("path");
|
|
33
|
+
const { RuleTester, SourceCode } = require("eslint");
|
|
34
|
+
const { isEditor, isValidFile, styleText } = require("./utils/helpers");
|
|
35
|
+
const { isValidEnv, isValidModel } = require("./utils/validate");
|
|
36
|
+
const {
|
|
37
|
+
Cache,
|
|
38
|
+
populateModelAndEnv,
|
|
39
|
+
hasCompilationError,
|
|
40
|
+
getAST,
|
|
41
|
+
loadConfigPath,
|
|
42
|
+
} = require("./utils/model");
|
|
43
|
+
const { isRuleDisabled, getRules, populateRules } = require("./utils/rules");
|
|
44
|
+
const { customRulesDir, categories } = require("./constants");
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Wrapper for ESLint's Rule creator:
|
|
48
|
+
* https://eslint.org/docs/developer-guide/working-with-rules
|
|
49
|
+
* - Must follow the ESLint prescribed convention for all rule exports
|
|
50
|
+
* - ESLint uses 'create' function to traverse its AST nodes
|
|
51
|
+
* - Since we do not work with an AST for cds models, a dummy 'Programm'
|
|
52
|
+
* node is used as an entry point
|
|
53
|
+
* - For all ESLint rules, we have two entry points for additional checks:
|
|
54
|
+
* 1. Before ESLint's rule creation via create()
|
|
55
|
+
* (see below)
|
|
56
|
+
* 2. Before ESLint's report via context.report()
|
|
57
|
+
* (see getProxyReport())
|
|
58
|
+
* @param {CDSRuleSpec} spec
|
|
59
|
+
* @returns {RuleModule}
|
|
60
|
+
*/
|
|
61
|
+
function createRule(spec) {
|
|
62
|
+
const { meta, create } = spec;
|
|
63
|
+
if (!meta.type) meta.type = "problem";
|
|
64
|
+
if (meta.docs && !meta.docs.category)
|
|
65
|
+
meta.docs.category = categories["model"];
|
|
66
|
+
return {
|
|
67
|
+
meta,
|
|
68
|
+
create: function (context) {
|
|
69
|
+
return {
|
|
70
|
+
Program: function (node) {
|
|
71
|
+
// --- Checks before create() ---
|
|
72
|
+
let cdscontext = createCDSContext(context, node, meta);
|
|
73
|
+
// 1. Is file exension allowed?
|
|
74
|
+
// (i.e. when using globs + other plugins)
|
|
75
|
+
if (
|
|
76
|
+
isValidFile(cdscontext.filePath) ||
|
|
77
|
+
meta.docs.category === categories["env"]
|
|
78
|
+
) {
|
|
79
|
+
// Update model/env contents and rules (at runtime)
|
|
80
|
+
populateModelAndEnv(cdscontext);
|
|
81
|
+
populateRules(cdscontext, customRulesDir);
|
|
82
|
+
// 2. Is rule allowed and model/env valid?
|
|
83
|
+
if (isValidEnv(cdscontext) || isValidModel(cdscontext)) {
|
|
84
|
+
try {
|
|
85
|
+
create(cdscontext);
|
|
86
|
+
} catch (err) {
|
|
87
|
+
// Do not throw to avoid ESLint VSCode editor pop-ups
|
|
88
|
+
styleText(
|
|
89
|
+
`Rule ${cdscontext.ruleID} has failed unexpectedly - please report this error!\n`,
|
|
90
|
+
["bold", "red"]
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
// Show compilation error only on console
|
|
94
|
+
} else if (hasCompilationError(cdscontext) && !isEditor()) {
|
|
95
|
+
create(cdscontext);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Experimental wrapper for 'createRule' to yield:
|
|
106
|
+
* - More eslint-like API
|
|
107
|
+
* - More convenience re error reports
|
|
108
|
+
* @param {CDSRuleSpec} spec
|
|
109
|
+
* @returns {RuleModule}
|
|
110
|
+
*/
|
|
111
|
+
function defineRule(spec) {
|
|
112
|
+
const { meta, create } = spec;
|
|
113
|
+
if (!meta.type) meta.type = "problem";
|
|
114
|
+
if (meta.docs && !meta.docs.category) meta.docs.category = "Model Validation";
|
|
115
|
+
return createRule({
|
|
116
|
+
meta,
|
|
117
|
+
create: (context) => {
|
|
118
|
+
const { cds, report } = context;
|
|
119
|
+
const handlers = create({
|
|
120
|
+
cds,
|
|
121
|
+
model: cds.model,
|
|
122
|
+
report: (r) => report(r),
|
|
123
|
+
});
|
|
124
|
+
if (cds.model) {
|
|
125
|
+
cds.model.forall((d) => {
|
|
126
|
+
for (let each in handlers)
|
|
127
|
+
if (d.is(each)) {
|
|
128
|
+
let r = handlers[each](d);
|
|
129
|
+
if (r) {
|
|
130
|
+
if (typeof r === "string") r = { message: r };
|
|
131
|
+
if (!r.loc) r.loc = cds.getLocation(d.name, d);
|
|
132
|
+
if (!r.file)
|
|
133
|
+
r.file = (d.$location && d.$location.file) || "unknown.cds";
|
|
134
|
+
context.report(r);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Generates proxy for ESLint's context object which adds caching
|
|
145
|
+
* @param obj ESLint's context object
|
|
146
|
+
* @returns Proxy for cds
|
|
147
|
+
*/
|
|
148
|
+
function getProxyReport(obj) {
|
|
149
|
+
const handler = {
|
|
150
|
+
get(target, prop, receiver) {
|
|
151
|
+
const value = Reflect.get(target, prop, receiver);
|
|
152
|
+
if (typeof value !== "object") {
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
/* eslint no-extra-boolean-cast: "off" */
|
|
156
|
+
if (!!value) {
|
|
157
|
+
return new Proxy(value, handler);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
err: `Property ${prop} prop does not exist on object ${obj}!`,
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
apply(target, thisArg, argumentsList) {
|
|
164
|
+
let report = false;
|
|
165
|
+
if (argumentsList.length > 0) {
|
|
166
|
+
argumentsList.forEach((lint) => {
|
|
167
|
+
if (lint) {
|
|
168
|
+
// --- Checks before context.report() ---
|
|
169
|
+
// 1. Is lint (loc) not disabled by ESLint disable comments?
|
|
170
|
+
if (!isRuleDisabled(lint, thisArg)) {
|
|
171
|
+
const fileRel = lint.file;
|
|
172
|
+
let fileAbs = lint.file || "";
|
|
173
|
+
if (!path.isAbsolute(fileAbs)) {
|
|
174
|
+
fileAbs = fileRel
|
|
175
|
+
? path.join(Cache.get("configpath"), fileRel)
|
|
176
|
+
: "";
|
|
177
|
+
}
|
|
178
|
+
// Only show 'env' lints on console
|
|
179
|
+
if (thisArg.category === "env" && !isEditor()) {
|
|
180
|
+
lint["loc"] = {
|
|
181
|
+
start: { line: 0, column: -1 },
|
|
182
|
+
end: { line: 0, column: -1 },
|
|
183
|
+
};
|
|
184
|
+
report = true;
|
|
185
|
+
// Only show 'model' lints at corrsponding file
|
|
186
|
+
} else if (
|
|
187
|
+
fileAbs === thisArg.filePath ||
|
|
188
|
+
fileRel === "<stdin>.cds"
|
|
189
|
+
) {
|
|
190
|
+
report = true;
|
|
191
|
+
}
|
|
192
|
+
if (report) {
|
|
193
|
+
return thisArg._context.report(lint);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
return new Proxy(obj, handler);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Expands CDS context object with some CDS properties
|
|
206
|
+
* We also retrieve the file contents cached by the preprocessor
|
|
207
|
+
* @param {RuleContext} context
|
|
208
|
+
* @param {RuleNode} node
|
|
209
|
+
* @returns cdscontext
|
|
210
|
+
*/
|
|
211
|
+
function createCDSContext(context, node, meta) {
|
|
212
|
+
const filePath = context.getPhysicalFilename();
|
|
213
|
+
const configPath = loadConfigPath(filePath);
|
|
214
|
+
let category = "model";
|
|
215
|
+
if (meta.docs.category === categories["env"]) {
|
|
216
|
+
category = "env";
|
|
217
|
+
}
|
|
218
|
+
let sourcecode = context.getSourceCode();
|
|
219
|
+
let code = sourcecode.getText(node);
|
|
220
|
+
if (!code) {
|
|
221
|
+
code = Cache.get(`file:${context.getPhysicalFilename()}`);
|
|
222
|
+
}
|
|
223
|
+
if (code) {
|
|
224
|
+
sourcecode = new SourceCode(code, getAST(code));
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
_context: context,
|
|
228
|
+
...context,
|
|
229
|
+
category,
|
|
230
|
+
cds: context.parserServices.cdsProxy || Cache.get("cds"),
|
|
231
|
+
configPath,
|
|
232
|
+
code,
|
|
233
|
+
filePath,
|
|
234
|
+
options: context.options,
|
|
235
|
+
report: getProxyReport(context.report),
|
|
236
|
+
ruleID: context.id,
|
|
237
|
+
sourcecode,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* ESLint RuleTester (used by custom rule creator api)
|
|
243
|
+
* Calls ESLint's RuleTester with custom cds parser and input for
|
|
244
|
+
* valid/invalid checks:
|
|
245
|
+
* Model checks require input 'code' entries
|
|
246
|
+
* Env checks require input 'options' with selected parameters
|
|
247
|
+
* @param {CDSRuleTestOpts} options RuleTester input options
|
|
248
|
+
* @returns RuleTester results
|
|
249
|
+
*/
|
|
250
|
+
function runRuleTester(options) {
|
|
251
|
+
process.env['RULE_TESTER'] = true;
|
|
252
|
+
let parser;
|
|
253
|
+
let rule = {};
|
|
254
|
+
const rulename = path.basename(options.root);
|
|
255
|
+
const plugin = "eslint-plugin-cds";
|
|
256
|
+
if (options.root.includes(plugin)) {
|
|
257
|
+
// For plugin's internal tests, resolve parser from here
|
|
258
|
+
parser = require.resolve("./parser");
|
|
259
|
+
rule = require(`./rules/${path.basename(options.root)}`);
|
|
260
|
+
Cache.set(
|
|
261
|
+
"rulesInfo",
|
|
262
|
+
getRules(path.join(path.dirname(options.root), "../../lib/impl/rules"))
|
|
263
|
+
);
|
|
264
|
+
} else {
|
|
265
|
+
// Otherwise from project root
|
|
266
|
+
const resolvedPlugin = require.resolve("@sap/eslint-plugin-cds", {
|
|
267
|
+
paths: [options.root],
|
|
268
|
+
});
|
|
269
|
+
parser = path.join(path.dirname(resolvedPlugin), "parser");
|
|
270
|
+
rule = require(path.join(
|
|
271
|
+
options.root,
|
|
272
|
+
`../../rules/${path.basename(options.root)}`
|
|
273
|
+
));
|
|
274
|
+
Cache.set("rulesInfo", getRules(path.join(options.root, "../../rules")));
|
|
275
|
+
}
|
|
276
|
+
let category = categories["model"];
|
|
277
|
+
if (rule.meta) {
|
|
278
|
+
category = rule.meta.docs.category;
|
|
279
|
+
}
|
|
280
|
+
let tester = new RuleTester({});
|
|
281
|
+
if (parser) {
|
|
282
|
+
tester = new RuleTester({ parser });
|
|
283
|
+
}
|
|
284
|
+
const testerCases = {};
|
|
285
|
+
["valid", "invalid"].forEach((type) => {
|
|
286
|
+
const filePath = path.join(options.root, `${type}/${options.filename}`);
|
|
287
|
+
testerCases[type] = [
|
|
288
|
+
{
|
|
289
|
+
filename: filePath,
|
|
290
|
+
},
|
|
291
|
+
];
|
|
292
|
+
if (category === categories["env"]) {
|
|
293
|
+
testerCases[type][0].code = "";
|
|
294
|
+
testerCases[type][0].options = [
|
|
295
|
+
{ environment: JSON.parse(fs.readFileSync(filePath, "utf8")) },
|
|
296
|
+
];
|
|
297
|
+
} else if (!category || category === categories.model) {
|
|
298
|
+
testerCases[type][0].code = fs.readFileSync(filePath, "utf8");
|
|
299
|
+
}
|
|
300
|
+
if (type === "invalid") {
|
|
301
|
+
testerCases[type][0].errors = options.errors;
|
|
302
|
+
const fileFixed = path.join(options.root, `fixed/${options.filename}`);
|
|
303
|
+
if (fs.existsSync(fileFixed)) {
|
|
304
|
+
testerCases[type][0].output = fs.readFileSync(fileFixed, "utf8");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
return tester.run(rulename, rule, testerCases);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
module.exports = { createRule, defineRule, runRuleTester };
|