eslint 4.1.1 → 4.4.1
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 +106 -0
- package/bin/eslint.js +5 -4
- package/conf/category-list.json +2 -2
- package/conf/config-schema.js +3 -1
- package/conf/eslint-recommended.js +12 -14
- package/lib/cli-engine.js +4 -3
- package/lib/cli.js +12 -1
- package/lib/config/config-file.js +5 -5
- package/lib/config/config-initializer.js +123 -14
- package/lib/config/config-validator.js +43 -14
- package/lib/config/plugins.js +13 -1
- package/lib/linter.js +26 -15
- package/lib/rule-context.js +53 -41
- package/lib/rules/arrow-parens.js +5 -2
- package/lib/rules/comma-dangle.js +40 -40
- package/lib/rules/curly.js +1 -1
- package/lib/rules/dot-notation.js +9 -0
- package/lib/rules/getter-return.js +176 -0
- package/lib/rules/id-blacklist.js +7 -3
- package/lib/rules/id-match.js +8 -4
- package/lib/rules/indent-legacy.js +2 -2
- package/lib/rules/indent.js +354 -349
- package/lib/rules/key-spacing.js +2 -2
- package/lib/rules/multiline-ternary.js +8 -2
- package/lib/rules/no-cond-assign.js +7 -3
- package/lib/rules/no-constant-condition.js +62 -6
- package/lib/rules/no-debugger.js +6 -1
- package/lib/rules/no-else-return.js +1 -1
- package/lib/rules/no-extra-parens.js +24 -11
- package/lib/rules/no-inner-declarations.js +8 -4
- package/lib/rules/no-multi-spaces.js +53 -115
- package/lib/rules/no-regex-spaces.js +4 -4
- package/lib/rules/no-restricted-globals.js +50 -9
- package/lib/rules/no-restricted-properties.js +19 -11
- package/lib/rules/no-sync.js +15 -3
- package/lib/rules/no-tabs.js +8 -4
- package/lib/rules/no-underscore-dangle.js +28 -1
- package/lib/rules/object-curly-newline.js +18 -0
- package/lib/rules/object-curly-spacing.js +1 -1
- package/lib/rules/padded-blocks.js +2 -2
- package/lib/rules/padding-line-between-statements.js +1 -1
- package/lib/rules/prefer-destructuring.js +70 -32
- package/lib/rules/prefer-numeric-literals.js +36 -7
- package/lib/rules/prefer-reflect.js +8 -4
- package/lib/rules/prefer-template.js +2 -2
- package/lib/rules/space-infix-ops.js +1 -1
- package/lib/rules/spaced-comment.js +2 -2
- package/lib/rules/valid-jsdoc.js +15 -7
- package/lib/testers/rule-tester.js +23 -30
- package/lib/testers/test-parser.js +48 -0
- package/lib/util/ajv.js +29 -0
- package/lib/util/npm-util.js +9 -8
- package/lib/util/source-code-fixer.js +47 -19
- package/package.json +11 -7
- package/conf/json-schema-schema.json +0 -150
@@ -9,7 +9,7 @@
|
|
9
9
|
/*
|
10
10
|
* This is a wrapper around mocha to allow for DRY unittests for eslint
|
11
11
|
* Format:
|
12
|
-
* RuleTester.
|
12
|
+
* RuleTester.run("{ruleName}", {
|
13
13
|
* valid: [
|
14
14
|
* "{code}",
|
15
15
|
* { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings} }
|
@@ -44,10 +44,9 @@ const lodash = require("lodash"),
|
|
44
44
|
assert = require("assert"),
|
45
45
|
util = require("util"),
|
46
46
|
validator = require("../config/config-validator"),
|
47
|
-
|
47
|
+
ajv = require("../util/ajv"),
|
48
48
|
Linter = require("../linter"),
|
49
49
|
Environments = require("../config/environments"),
|
50
|
-
metaSchema = require("../../conf/json-schema-schema.json"),
|
51
50
|
SourceCodeFixer = require("../util/source-code-fixer");
|
52
51
|
|
53
52
|
//------------------------------------------------------------------------------
|
@@ -73,8 +72,6 @@ const RuleTesterParameters = [
|
|
73
72
|
"output"
|
74
73
|
];
|
75
74
|
|
76
|
-
const validateSchema = validate(metaSchema, { verbose: true });
|
77
|
-
|
78
75
|
const hasOwnProperty = Function.call.bind(Object.hasOwnProperty);
|
79
76
|
|
80
77
|
/**
|
@@ -253,7 +250,6 @@ class RuleTester {
|
|
253
250
|
const testerConfig = this.testerConfig,
|
254
251
|
requiredScenarios = ["valid", "invalid"],
|
255
252
|
scenarioErrors = [],
|
256
|
-
result = {},
|
257
253
|
linter = this.linter;
|
258
254
|
|
259
255
|
if (lodash.isNil(test) || typeof test !== "object") {
|
@@ -272,16 +268,13 @@ class RuleTester {
|
|
272
268
|
].concat(scenarioErrors).join("\n"));
|
273
269
|
}
|
274
270
|
|
275
|
-
/* eslint-disable no-shadow */
|
276
|
-
|
277
271
|
/**
|
278
272
|
* Run the rule for the given item
|
279
|
-
* @param {string} ruleName name of the rule
|
280
273
|
* @param {string|Object} item Item to run the rule against
|
281
274
|
* @returns {Object} Eslint run result
|
282
275
|
* @private
|
283
276
|
*/
|
284
|
-
function runRuleForItem(
|
277
|
+
function runRuleForItem(item) {
|
285
278
|
let config = lodash.cloneDeep(testerConfig),
|
286
279
|
code, filename, beforeAST, afterAST;
|
287
280
|
|
@@ -318,12 +311,16 @@ class RuleTester {
|
|
318
311
|
const schema = validator.getRuleOptionsSchema(ruleName, linter.rules);
|
319
312
|
|
320
313
|
if (schema) {
|
321
|
-
validateSchema(schema);
|
314
|
+
ajv.validateSchema(schema);
|
315
|
+
|
316
|
+
if (ajv.errors) {
|
317
|
+
const errors = ajv.errors.map(error => {
|
318
|
+
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
322
319
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
320
|
+
return `\t${field}: ${error.message}`;
|
321
|
+
}).join("\n");
|
322
|
+
|
323
|
+
throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
|
327
324
|
}
|
328
325
|
}
|
329
326
|
|
@@ -349,27 +346,27 @@ class RuleTester {
|
|
349
346
|
|
350
347
|
try {
|
351
348
|
linter.rules.get = function(ruleId) {
|
352
|
-
const
|
349
|
+
const originalRule = originalGet.call(linter.rules, ruleId);
|
353
350
|
|
354
|
-
if (typeof
|
351
|
+
if (typeof originalRule === "function") {
|
355
352
|
return function(context) {
|
356
353
|
Object.freeze(context);
|
357
354
|
freezeDeeply(context.options);
|
358
355
|
freezeDeeply(context.settings);
|
359
356
|
freezeDeeply(context.parserOptions);
|
360
357
|
|
361
|
-
return
|
358
|
+
return originalRule(context);
|
362
359
|
};
|
363
360
|
}
|
364
361
|
return {
|
365
|
-
meta:
|
362
|
+
meta: originalRule.meta,
|
366
363
|
create(context) {
|
367
364
|
Object.freeze(context);
|
368
365
|
freezeDeeply(context.options);
|
369
366
|
freezeDeeply(context.settings);
|
370
367
|
freezeDeeply(context.parserOptions);
|
371
368
|
|
372
|
-
return
|
369
|
+
return originalRule.create(context);
|
373
370
|
}
|
374
371
|
};
|
375
372
|
|
@@ -403,13 +400,12 @@ class RuleTester {
|
|
403
400
|
/**
|
404
401
|
* Check if the template is valid or not
|
405
402
|
* all valid cases go through this
|
406
|
-
* @param {string} ruleName name of the rule
|
407
403
|
* @param {string|Object} item Item to run the rule against
|
408
404
|
* @returns {void}
|
409
405
|
* @private
|
410
406
|
*/
|
411
|
-
function testValidTemplate(
|
412
|
-
const result = runRuleForItem(
|
407
|
+
function testValidTemplate(item) {
|
408
|
+
const result = runRuleForItem(item);
|
413
409
|
const messages = result.messages;
|
414
410
|
|
415
411
|
assert.equal(messages.length, 0, util.format("Should have no errors but had %d: %s",
|
@@ -443,16 +439,15 @@ class RuleTester {
|
|
443
439
|
/**
|
444
440
|
* Check if the template is invalid or not
|
445
441
|
* all invalid cases go through this.
|
446
|
-
* @param {string} ruleName name of the rule
|
447
442
|
* @param {string|Object} item Item to run the rule against
|
448
443
|
* @returns {void}
|
449
444
|
* @private
|
450
445
|
*/
|
451
|
-
function testInvalidTemplate(
|
446
|
+
function testInvalidTemplate(item) {
|
452
447
|
assert.ok(item.errors || item.errors === 0,
|
453
448
|
`Did not specify errors for an invalid test of ${ruleName}`);
|
454
449
|
|
455
|
-
const result = runRuleForItem(
|
450
|
+
const result = runRuleForItem(item);
|
456
451
|
const messages = result.messages;
|
457
452
|
|
458
453
|
|
@@ -542,7 +537,7 @@ class RuleTester {
|
|
542
537
|
test.valid.forEach(valid => {
|
543
538
|
RuleTester.it(typeof valid === "object" ? valid.code : valid, () => {
|
544
539
|
linter.defineRules(this.rules);
|
545
|
-
testValidTemplate(
|
540
|
+
testValidTemplate(valid);
|
546
541
|
});
|
547
542
|
});
|
548
543
|
});
|
@@ -551,13 +546,11 @@ class RuleTester {
|
|
551
546
|
test.invalid.forEach(invalid => {
|
552
547
|
RuleTester.it(invalid.code, () => {
|
553
548
|
linter.defineRules(this.rules);
|
554
|
-
testInvalidTemplate(
|
549
|
+
testInvalidTemplate(invalid);
|
555
550
|
});
|
556
551
|
});
|
557
552
|
});
|
558
553
|
});
|
559
|
-
|
560
|
-
return result.suite;
|
561
554
|
}
|
562
555
|
}
|
563
556
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
3
|
+
*/
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
const espree = require("espree");
|
7
|
+
const Traverser = require("../util/traverser");
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Define `start`/`end` properties as throwing error.
|
11
|
+
* @param {ASTNode} node The node to define.
|
12
|
+
* @returns {void}
|
13
|
+
*/
|
14
|
+
function defineStartEndAsError(node) {
|
15
|
+
Object.defineProperty(node, "start", {
|
16
|
+
get() {
|
17
|
+
throw new Error("Use node.range[0] instead of node.start");
|
18
|
+
},
|
19
|
+
configurable: true,
|
20
|
+
enumerable: false
|
21
|
+
});
|
22
|
+
Object.defineProperty(node, "end", {
|
23
|
+
get() {
|
24
|
+
throw new Error("Use node.range[1] instead of node.end");
|
25
|
+
},
|
26
|
+
configurable: true,
|
27
|
+
enumerable: false
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Define `start`/`end` properties of all nodes of the given AST as throwing error.
|
33
|
+
* @param {ASTNode} ast The root node to errorize `start`/`end` properties.
|
34
|
+
* @returns {void}
|
35
|
+
*/
|
36
|
+
function defineStartEndAsErrorInTree(ast) {
|
37
|
+
new Traverser().traverse(ast, { enter: defineStartEndAsError });
|
38
|
+
ast.tokens.forEach(defineStartEndAsError);
|
39
|
+
ast.comments.forEach(defineStartEndAsError);
|
40
|
+
}
|
41
|
+
|
42
|
+
module.exports.parse = (code, options) => {
|
43
|
+
const ret = espree.parse(code, options);
|
44
|
+
|
45
|
+
defineStartEndAsErrorInTree(ret.ast || ret);
|
46
|
+
|
47
|
+
return ret;
|
48
|
+
};
|
package/lib/util/ajv.js
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview The instance of Ajv validator.
|
3
|
+
* @author Evgeny Poberezkin
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Requirements
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
const Ajv = require("ajv"),
|
12
|
+
metaSchema = require("ajv/lib/refs/json-schema-draft-04.json");
|
13
|
+
|
14
|
+
//------------------------------------------------------------------------------
|
15
|
+
// Public Interface
|
16
|
+
//------------------------------------------------------------------------------
|
17
|
+
|
18
|
+
const ajv = new Ajv({
|
19
|
+
meta: false,
|
20
|
+
validateSchema: false,
|
21
|
+
missingRefs: "ignore",
|
22
|
+
verbose: true
|
23
|
+
});
|
24
|
+
|
25
|
+
ajv.addMetaSchema(metaSchema);
|
26
|
+
// eslint-disable-next-line no-underscore-dangle
|
27
|
+
ajv._opts.defaultMeta = metaSchema.id;
|
28
|
+
|
29
|
+
module.exports = ajv;
|
package/lib/util/npm-util.js
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
//------------------------------------------------------------------------------
|
11
11
|
|
12
12
|
const fs = require("fs"),
|
13
|
-
|
13
|
+
spawn = require("cross-spawn"),
|
14
14
|
path = require("path"),
|
15
15
|
log = require("../logging");
|
16
16
|
|
@@ -50,22 +50,23 @@ function findPackageJson(startDir) {
|
|
50
50
|
* @returns {void}
|
51
51
|
*/
|
52
52
|
function installSyncSaveDev(packages) {
|
53
|
-
if (Array.isArray(packages)) {
|
54
|
-
packages = packages
|
53
|
+
if (!Array.isArray(packages)) {
|
54
|
+
packages = [packages];
|
55
55
|
}
|
56
|
-
|
56
|
+
spawn.sync("npm", ["i", "--save-dev"].concat(packages), { stdio: "inherit" });
|
57
57
|
}
|
58
58
|
|
59
59
|
/**
|
60
60
|
* Fetch `peerDependencies` of the given package by `npm show` command.
|
61
61
|
* @param {string} packageName The package name to fetch peerDependencies.
|
62
|
-
* @returns {
|
62
|
+
* @returns {Object} Gotten peerDependencies.
|
63
63
|
*/
|
64
64
|
function fetchPeerDependencies(packageName) {
|
65
|
-
const fetchedText =
|
66
|
-
|
65
|
+
const fetchedText = spawn.sync(
|
66
|
+
"npm",
|
67
|
+
["show", "--json", packageName, "peerDependencies"],
|
67
68
|
{ encoding: "utf8" }
|
68
|
-
).trim();
|
69
|
+
).stdout.trim();
|
69
70
|
|
70
71
|
return JSON.parse(fetchedText || "{}");
|
71
72
|
}
|
@@ -55,10 +55,10 @@ function SourceCodeFixer() {
|
|
55
55
|
* smart about the fixes and won't apply fixes over the same area in the text.
|
56
56
|
* @param {SourceCode} sourceCode The source code to apply the changes to.
|
57
57
|
* @param {Message[]} messages The array of messages reported by ESLint.
|
58
|
+
* @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed
|
58
59
|
* @returns {Object} An object containing the fixed text and any unfixed messages.
|
59
60
|
*/
|
60
|
-
SourceCodeFixer.applyFixes = function(sourceCode, messages) {
|
61
|
-
|
61
|
+
SourceCodeFixer.applyFixes = function(sourceCode, messages, shouldFix) {
|
62
62
|
debug("Applying fixes");
|
63
63
|
|
64
64
|
if (!sourceCode) {
|
@@ -70,6 +70,15 @@ SourceCodeFixer.applyFixes = function(sourceCode, messages) {
|
|
70
70
|
};
|
71
71
|
}
|
72
72
|
|
73
|
+
if (shouldFix === false) {
|
74
|
+
debug("shouldFix parameter was false, not attempting fixes");
|
75
|
+
return {
|
76
|
+
fixed: false,
|
77
|
+
messages,
|
78
|
+
output: sourceCode.text
|
79
|
+
};
|
80
|
+
}
|
81
|
+
|
73
82
|
// clone the array
|
74
83
|
const remainingMessages = [],
|
75
84
|
fixes = [],
|
@@ -78,6 +87,34 @@ SourceCodeFixer.applyFixes = function(sourceCode, messages) {
|
|
78
87
|
let lastPos = Number.NEGATIVE_INFINITY,
|
79
88
|
output = bom;
|
80
89
|
|
90
|
+
/**
|
91
|
+
* Try to use the 'fix' from a problem.
|
92
|
+
* @param {Message} problem The message object to apply fixes from
|
93
|
+
* @returns {boolean} Whether fix was successfully applied
|
94
|
+
*/
|
95
|
+
function attemptFix(problem) {
|
96
|
+
const fix = problem.fix;
|
97
|
+
const start = fix.range[0];
|
98
|
+
const end = fix.range[1];
|
99
|
+
|
100
|
+
// Remain it as a problem if it's overlapped or it's a negative range
|
101
|
+
if (lastPos >= start || start > end) {
|
102
|
+
remainingMessages.push(problem);
|
103
|
+
return false;
|
104
|
+
}
|
105
|
+
|
106
|
+
// Remove BOM.
|
107
|
+
if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) {
|
108
|
+
output = "";
|
109
|
+
}
|
110
|
+
|
111
|
+
// Make output to this fix.
|
112
|
+
output += text.slice(Math.max(0, lastPos), Math.max(0, start));
|
113
|
+
output += fix.text;
|
114
|
+
lastPos = end;
|
115
|
+
return true;
|
116
|
+
}
|
117
|
+
|
81
118
|
messages.forEach(problem => {
|
82
119
|
if (problem.hasOwnProperty("fix")) {
|
83
120
|
fixes.push(problem);
|
@@ -88,32 +125,23 @@ SourceCodeFixer.applyFixes = function(sourceCode, messages) {
|
|
88
125
|
|
89
126
|
if (fixes.length) {
|
90
127
|
debug("Found fixes to apply");
|
128
|
+
let fixesWereApplied = false;
|
91
129
|
|
92
130
|
for (const problem of fixes.sort(compareMessagesByFixRange)) {
|
93
|
-
|
94
|
-
|
95
|
-
const end = fix.range[1];
|
131
|
+
if (typeof shouldFix !== "function" || shouldFix(problem)) {
|
132
|
+
attemptFix(problem);
|
96
133
|
|
97
|
-
|
98
|
-
|
134
|
+
// The only time attemptFix will fail is if a previous fix was
|
135
|
+
// applied which conflicts with it. So we can mark this as true.
|
136
|
+
fixesWereApplied = true;
|
137
|
+
} else {
|
99
138
|
remainingMessages.push(problem);
|
100
|
-
continue;
|
101
|
-
}
|
102
|
-
|
103
|
-
// Remove BOM.
|
104
|
-
if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) {
|
105
|
-
output = "";
|
106
139
|
}
|
107
|
-
|
108
|
-
// Make output to this fix.
|
109
|
-
output += text.slice(Math.max(0, lastPos), Math.max(0, start));
|
110
|
-
output += fix.text;
|
111
|
-
lastPos = end;
|
112
140
|
}
|
113
141
|
output += text.slice(Math.max(0, lastPos));
|
114
142
|
|
115
143
|
return {
|
116
|
-
fixed:
|
144
|
+
fixed: fixesWereApplied,
|
117
145
|
messages: remainingMessages.sort(compareMessagesByLocation),
|
118
146
|
output
|
119
147
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.4.1",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"bin": {
|
@@ -10,6 +10,7 @@
|
|
10
10
|
"scripts": {
|
11
11
|
"test": "node Makefile.js test",
|
12
12
|
"lint": "node Makefile.js lint",
|
13
|
+
"fuzz": "node Makefile.js fuzz",
|
13
14
|
"release": "node Makefile.js release",
|
14
15
|
"ci-release": "node Makefile.js ciRelease",
|
15
16
|
"alpharelease": "node Makefile.js prerelease -- alpha",
|
@@ -34,25 +35,27 @@
|
|
34
35
|
"homepage": "http://eslint.org",
|
35
36
|
"bugs": "https://github.com/eslint/eslint/issues/",
|
36
37
|
"dependencies": {
|
38
|
+
"ajv": "^5.2.0",
|
37
39
|
"babel-code-frame": "^6.22.0",
|
38
40
|
"chalk": "^1.1.3",
|
39
41
|
"concat-stream": "^1.6.0",
|
42
|
+
"cross-spawn": "^5.1.0",
|
40
43
|
"debug": "^2.6.8",
|
41
44
|
"doctrine": "^2.0.0",
|
42
45
|
"eslint-scope": "^3.7.1",
|
43
|
-
"espree": "^3.
|
46
|
+
"espree": "^3.5.0",
|
44
47
|
"esquery": "^1.0.0",
|
45
48
|
"estraverse": "^4.2.0",
|
46
49
|
"esutils": "^2.0.2",
|
47
50
|
"file-entry-cache": "^2.0.0",
|
51
|
+
"functional-red-black-tree": "^1.0.1",
|
48
52
|
"glob": "^7.1.2",
|
49
53
|
"globals": "^9.17.0",
|
50
54
|
"ignore": "^3.3.3",
|
51
55
|
"imurmurhash": "^0.1.4",
|
52
56
|
"inquirer": "^3.0.6",
|
53
|
-
"is-my-json-valid": "^2.16.0",
|
54
57
|
"is-resolvable": "^1.0.0",
|
55
|
-
"js-yaml": "^3.
|
58
|
+
"js-yaml": "^3.9.1",
|
56
59
|
"json-stable-stringify": "^1.0.1",
|
57
60
|
"levn": "^0.3.0",
|
58
61
|
"lodash": "^4.17.4",
|
@@ -64,6 +67,7 @@
|
|
64
67
|
"pluralize": "^4.0.0",
|
65
68
|
"progress": "^2.0.0",
|
66
69
|
"require-uncached": "^1.0.3",
|
70
|
+
"semver": "^5.3.0",
|
67
71
|
"strip-json-comments": "~2.0.1",
|
68
72
|
"table": "^4.0.1",
|
69
73
|
"text-table": "~0.2.0"
|
@@ -80,9 +84,10 @@
|
|
80
84
|
"coveralls": "^2.13.1",
|
81
85
|
"dateformat": "^2.0.0",
|
82
86
|
"ejs": "^2.5.6",
|
83
|
-
"eslint-plugin-eslint-plugin": "^0.
|
84
|
-
"eslint-plugin-node": "^5.
|
87
|
+
"eslint-plugin-eslint-plugin": "^0.8.0",
|
88
|
+
"eslint-plugin-node": "^5.1.0",
|
85
89
|
"eslint-release": "^0.10.1",
|
90
|
+
"eslump": "1.6.0",
|
86
91
|
"esprima": "^3.1.3",
|
87
92
|
"esprima-fb": "^15001.1001.0-dev-harmony-fb",
|
88
93
|
"istanbul": "^0.4.5",
|
@@ -100,7 +105,6 @@
|
|
100
105
|
"npm-license": "^0.3.3",
|
101
106
|
"phantomjs-prebuilt": "^2.1.14",
|
102
107
|
"proxyquire": "^1.8.0",
|
103
|
-
"semver": "^5.3.0",
|
104
108
|
"shelljs": "^0.7.7",
|
105
109
|
"shelljs-nodecli": "~0.1.1",
|
106
110
|
"sinon": "^2.3.2",
|
@@ -1,150 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"id": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
4
|
-
"description": "Core schema meta-schema",
|
5
|
-
"definitions": {
|
6
|
-
"schemaArray": {
|
7
|
-
"type": "array",
|
8
|
-
"minItems": 1,
|
9
|
-
"items": { "$ref": "#" }
|
10
|
-
},
|
11
|
-
"positiveInteger": {
|
12
|
-
"type": "integer",
|
13
|
-
"minimum": 0
|
14
|
-
},
|
15
|
-
"positiveIntegerDefault0": {
|
16
|
-
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
|
17
|
-
},
|
18
|
-
"simpleTypes": {
|
19
|
-
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
|
20
|
-
},
|
21
|
-
"stringArray": {
|
22
|
-
"type": "array",
|
23
|
-
"items": { "type": "string" },
|
24
|
-
"minItems": 1,
|
25
|
-
"uniqueItems": true
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"type": "object",
|
29
|
-
"properties": {
|
30
|
-
"id": {
|
31
|
-
"type": "string",
|
32
|
-
"format": "uri"
|
33
|
-
},
|
34
|
-
"$schema": {
|
35
|
-
"type": "string",
|
36
|
-
"format": "uri"
|
37
|
-
},
|
38
|
-
"title": {
|
39
|
-
"type": "string"
|
40
|
-
},
|
41
|
-
"description": {
|
42
|
-
"type": "string"
|
43
|
-
},
|
44
|
-
"default": {},
|
45
|
-
"multipleOf": {
|
46
|
-
"type": "number",
|
47
|
-
"minimum": 0,
|
48
|
-
"exclusiveMinimum": true
|
49
|
-
},
|
50
|
-
"maximum": {
|
51
|
-
"type": "number"
|
52
|
-
},
|
53
|
-
"exclusiveMaximum": {
|
54
|
-
"type": "boolean",
|
55
|
-
"default": false
|
56
|
-
},
|
57
|
-
"minimum": {
|
58
|
-
"type": "number"
|
59
|
-
},
|
60
|
-
"exclusiveMinimum": {
|
61
|
-
"type": "boolean",
|
62
|
-
"default": false
|
63
|
-
},
|
64
|
-
"maxLength": { "$ref": "#/definitions/positiveInteger" },
|
65
|
-
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
66
|
-
"pattern": {
|
67
|
-
"type": "string",
|
68
|
-
"format": "regex"
|
69
|
-
},
|
70
|
-
"additionalItems": {
|
71
|
-
"anyOf": [
|
72
|
-
{ "type": "boolean" },
|
73
|
-
{ "$ref": "#" }
|
74
|
-
],
|
75
|
-
"default": {}
|
76
|
-
},
|
77
|
-
"items": {
|
78
|
-
"anyOf": [
|
79
|
-
{ "$ref": "#" },
|
80
|
-
{ "$ref": "#/definitions/schemaArray" }
|
81
|
-
],
|
82
|
-
"default": {}
|
83
|
-
},
|
84
|
-
"maxItems": { "$ref": "#/definitions/positiveInteger" },
|
85
|
-
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
86
|
-
"uniqueItems": {
|
87
|
-
"type": "boolean",
|
88
|
-
"default": false
|
89
|
-
},
|
90
|
-
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
|
91
|
-
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
92
|
-
"required": { "$ref": "#/definitions/stringArray" },
|
93
|
-
"additionalProperties": {
|
94
|
-
"anyOf": [
|
95
|
-
{ "type": "boolean" },
|
96
|
-
{ "$ref": "#" }
|
97
|
-
],
|
98
|
-
"default": {}
|
99
|
-
},
|
100
|
-
"definitions": {
|
101
|
-
"type": "object",
|
102
|
-
"additionalProperties": { "$ref": "#" },
|
103
|
-
"default": {}
|
104
|
-
},
|
105
|
-
"properties": {
|
106
|
-
"type": "object",
|
107
|
-
"additionalProperties": { "$ref": "#" },
|
108
|
-
"default": {}
|
109
|
-
},
|
110
|
-
"patternProperties": {
|
111
|
-
"type": "object",
|
112
|
-
"additionalProperties": { "$ref": "#" },
|
113
|
-
"default": {}
|
114
|
-
},
|
115
|
-
"dependencies": {
|
116
|
-
"type": "object",
|
117
|
-
"additionalProperties": {
|
118
|
-
"anyOf": [
|
119
|
-
{ "$ref": "#" },
|
120
|
-
{ "$ref": "#/definitions/stringArray" }
|
121
|
-
]
|
122
|
-
}
|
123
|
-
},
|
124
|
-
"enum": {
|
125
|
-
"type": "array",
|
126
|
-
"minItems": 1,
|
127
|
-
"uniqueItems": true
|
128
|
-
},
|
129
|
-
"type": {
|
130
|
-
"anyOf": [
|
131
|
-
{ "$ref": "#/definitions/simpleTypes" },
|
132
|
-
{
|
133
|
-
"type": "array",
|
134
|
-
"items": { "$ref": "#/definitions/simpleTypes" },
|
135
|
-
"minItems": 1,
|
136
|
-
"uniqueItems": true
|
137
|
-
}
|
138
|
-
]
|
139
|
-
},
|
140
|
-
"allOf": { "$ref": "#/definitions/schemaArray" },
|
141
|
-
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
142
|
-
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
143
|
-
"not": { "$ref": "#" }
|
144
|
-
},
|
145
|
-
"dependencies": {
|
146
|
-
"exclusiveMaximum": [ "maximum" ],
|
147
|
-
"exclusiveMinimum": [ "minimum" ]
|
148
|
-
},
|
149
|
-
"default": {}
|
150
|
-
}
|