Skip to content

Commit a682f35

Browse files
committed
Update eslint, jscs, browserify
1 parent 539390b commit a682f35

File tree

5 files changed

+57
-59
lines changed

5 files changed

+57
-59
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "eslint:recommended",
23
"env": {
34
"node": true,
45
"browser": true

.jscs.json

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,20 @@
1010
"mdast-zone.js",
1111
"mdast-zone.min.js"
1212
],
13-
"plugins": [
14-
"jscs-jsdoc"
15-
],
1613
"jsDoc": {
1714
"checkAnnotations": "jsdoc3",
1815
"checkParamNames": true,
19-
"requireParamTypes": true,
16+
"checkRedundantAccess": true,
2017
"checkRedundantParams": true,
21-
"checkReturnTypes": true,
2218
"checkRedundantReturns": true,
23-
"requireReturnTypes": true,
19+
"checkReturnTypes": true,
2420
"checkTypes": "strictNativeCase",
25-
"checkRedundantAccess": true,
2621
"enforceExistence": true,
27-
"requireHyphenBeforeDescription": true
22+
"requireHyphenBeforeDescription": true,
23+
"requireNewlineAfterDescription": true,
24+
"requireParamTypes": true,
25+
"requireParamDescription": true,
26+
"requireReturnTypes": true
2827
},
2928
"requireCurlyBraces": [
3029
"if",
@@ -49,6 +48,9 @@
4948
"requireSpaceBeforeBlockStatements": true,
5049
"requireParenthesesAroundIIFE": true,
5150
"requireSpacesInConditionalExpression": true,
51+
"requireSpacesInFunctionExpression": {
52+
"beforeOpeningCurlyBrace": true
53+
},
5254
"requireSpacesInAnonymousFunctionExpression": {
5355
"beforeOpeningRoundBrace": true,
5456
"beforeOpeningCurlyBrace": true
@@ -57,11 +59,7 @@
5759
"beforeOpeningRoundBrace": true,
5860
"beforeOpeningCurlyBrace": true
5961
},
60-
"requireSpacesInFunctionExpression": {
61-
"beforeOpeningCurlyBrace": true
62-
},
6362
"requireBlocksOnNewline": true,
64-
"disallowPaddingNewlinesInBlocks": true,
6563
"disallowEmptyBlocks": true,
6664
"disallowSpacesInsideObjectBrackets": true,
6765
"disallowSpacesInsideArrayBrackets": true,
@@ -131,6 +129,7 @@
131129
"with"
132130
],
133131
"disallowMultipleLineStrings": true,
132+
"disallowMultipleLineBreaks": true,
134133
"validateLineBreaks": "LF",
135134
"validateQuoteMarks": "'",
136135
"disallowMixedSpacesAndTabs": true,
@@ -140,14 +139,8 @@
140139
"else"
141140
],
142141
"requireLineFeedAtFileEnd": true,
143-
"maximumLineLength": 78,
144142
"requireCapitalizedConstructors": true,
145143
"safeContextKeyword": "self",
146144
"requireDotNotation": true,
147-
"disallowYodaConditions": true,
148-
"validateJSDoc": {
149-
"checkParamNames": true,
150-
"checkRedundantParams": true,
151-
"requireParamTypes": true
152-
}
145+
"disallowYodaConditions": true
153146
}

index.js

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var PARAMETERS = new RegExp(
6060
/**
6161
* Create an expression which matches a marker.
6262
*
63-
* @param {string} name
63+
* @param {string} name - Plug-in name.
6464
* @return {RegExp}
6565
*/
6666
function marker(name) {
@@ -92,7 +92,7 @@ function marker(name) {
9292
/**
9393
* Parse `value` into an object.
9494
*
95-
* @param {string} value
95+
* @param {string} value - HTML comment.
9696
* @return {Object}
9797
*/
9898
function parameters(value) {
@@ -120,8 +120,9 @@ function parameters(value) {
120120
/**
121121
* Factory to test if `node` matches `settings`.
122122
*
123-
* @param {Object} settings
124-
* @param {function(Object)} callback
123+
* @param {Object} settings - Configuration.
124+
* @param {Function} callback - Invoked iwht a matching
125+
* HTML node.
125126
* @return {Function}
126127
*/
127128
function testFactory(settings, callback) {
@@ -131,8 +132,8 @@ function testFactory(settings, callback) {
131132
/**
132133
* Test if `node` matches the bound settings.
133134
*
134-
* @param {Node} node
135-
* @param {Parser|Compiler} [context]
135+
* @param {MDASTNode} node - Node to check.
136+
* @param {Parser|Compiler} [context] - Context class.
136137
* @return {Object?}
137138
*/
138139
function test(node, context) {
@@ -175,7 +176,7 @@ function testFactory(settings, callback) {
175176
* Parse factory.
176177
*
177178
* @param {Function} tokenize - Previous parser.
178-
* @param {Object} settings
179+
* @param {Object} settings - Configuration.
179180
*/
180181
function parse(tokenize, settings) {
181182
var callback = settings.onparse;
@@ -203,7 +204,7 @@ function parse(tokenize, settings) {
203204
* Stringify factory.
204205
*
205206
* @param {Function} compile - Previous compiler.
206-
* @param {Object} settings
207+
* @param {Object} settings - Configuration.
207208
*/
208209
function stringify(compile, settings) {
209210
var callback = settings.onstringify;
@@ -216,7 +217,7 @@ function stringify(compile, settings) {
216217
/**
217218
* Stringify HTML.
218219
*
219-
* @param {Object} node
220+
* @param {MDASTHTMLNode} node - HTML node.
220221
* @return {string}
221222
*/
222223
return function (node) {
@@ -229,7 +230,7 @@ function stringify(compile, settings) {
229230
/**
230231
* Run factory.
231232
*
232-
* @param {Object} settings
233+
* @param {Object} settings - Configuration.
233234
*/
234235
function run(settings) {
235236
var callback = settings.onrun;
@@ -245,9 +246,10 @@ function run(settings) {
245246
*
246247
* Passed intto `visit`.
247248
*
248-
* @param {Node} node
249-
* @param {number} index
250-
* @param {Node} parent
249+
* @param {MDASTNode} node - node to check.
250+
* @param {number} index - Position of `node` in
251+
* `parent`.
252+
* @param {MDASTNode} parent - Parent of `node`.
251253
*/
252254
function gather(node, index, parent) {
253255
var result = test(node);
@@ -295,7 +297,7 @@ function run(settings) {
295297
/**
296298
* Modify AST.
297299
*
298-
* @param {Object} node
300+
* @param {MDASTNode} node - Root node.
299301
*/
300302
return function (node) {
301303
visit(node, gather);
@@ -306,8 +308,8 @@ function run(settings) {
306308
* Modify mdast to invoke callbacks when HTML commnts are
307309
* found.
308310
*
309-
* @param {MDAST} mdast
310-
* @param {Object?} options
311+
* @param {MDAST} mdast - Instance.
312+
* @param {Object?} [options] - Configuration.
311313
* @return {Function?}
312314
*/
313315
function attacher(mdast, options) {
@@ -337,7 +339,7 @@ function attacher(mdast, options) {
337339
* Reason for this is that **mdast** only allows a single
338340
* function to be `use`d once.
339341
*
340-
* @param {Object} options
342+
* @param {Object} options - Plugin configuration.
341343
* @return {Function}
342344
*/
343345
function wrapper(options) {

mdast-zone.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var PARAMETERS = new RegExp(
6161
/**
6262
* Create an expression which matches a marker.
6363
*
64-
* @param {string} name
64+
* @param {string} name - Plug-in name.
6565
* @return {RegExp}
6666
*/
6767
function marker(name) {
@@ -93,7 +93,7 @@ function marker(name) {
9393
/**
9494
* Parse `value` into an object.
9595
*
96-
* @param {string} value
96+
* @param {string} value - HTML comment.
9797
* @return {Object}
9898
*/
9999
function parameters(value) {
@@ -121,8 +121,9 @@ function parameters(value) {
121121
/**
122122
* Factory to test if `node` matches `settings`.
123123
*
124-
* @param {Object} settings
125-
* @param {function(Object)} callback
124+
* @param {Object} settings - Configuration.
125+
* @param {Function} callback - Invoked iwht a matching
126+
* HTML node.
126127
* @return {Function}
127128
*/
128129
function testFactory(settings, callback) {
@@ -132,8 +133,8 @@ function testFactory(settings, callback) {
132133
/**
133134
* Test if `node` matches the bound settings.
134135
*
135-
* @param {Node} node
136-
* @param {Parser|Compiler} [context]
136+
* @param {MDASTNode} node - Node to check.
137+
* @param {Parser|Compiler} [context] - Context class.
137138
* @return {Object?}
138139
*/
139140
function test(node, context) {
@@ -176,7 +177,7 @@ function testFactory(settings, callback) {
176177
* Parse factory.
177178
*
178179
* @param {Function} tokenize - Previous parser.
179-
* @param {Object} settings
180+
* @param {Object} settings - Configuration.
180181
*/
181182
function parse(tokenize, settings) {
182183
var callback = settings.onparse;
@@ -204,7 +205,7 @@ function parse(tokenize, settings) {
204205
* Stringify factory.
205206
*
206207
* @param {Function} compile - Previous compiler.
207-
* @param {Object} settings
208+
* @param {Object} settings - Configuration.
208209
*/
209210
function stringify(compile, settings) {
210211
var callback = settings.onstringify;
@@ -217,7 +218,7 @@ function stringify(compile, settings) {
217218
/**
218219
* Stringify HTML.
219220
*
220-
* @param {Object} node
221+
* @param {MDASTHTMLNode} node - HTML node.
221222
* @return {string}
222223
*/
223224
return function (node) {
@@ -230,7 +231,7 @@ function stringify(compile, settings) {
230231
/**
231232
* Run factory.
232233
*
233-
* @param {Object} settings
234+
* @param {Object} settings - Configuration.
234235
*/
235236
function run(settings) {
236237
var callback = settings.onrun;
@@ -246,9 +247,10 @@ function run(settings) {
246247
*
247248
* Passed intto `visit`.
248249
*
249-
* @param {Node} node
250-
* @param {number} index
251-
* @param {Node} parent
250+
* @param {MDASTNode} node - node to check.
251+
* @param {number} index - Position of `node` in
252+
* `parent`.
253+
* @param {MDASTNode} parent - Parent of `node`.
252254
*/
253255
function gather(node, index, parent) {
254256
var result = test(node);
@@ -296,7 +298,7 @@ function run(settings) {
296298
/**
297299
* Modify AST.
298300
*
299-
* @param {Object} node
301+
* @param {MDASTNode} node - Root node.
300302
*/
301303
return function (node) {
302304
visit(node, gather);
@@ -307,8 +309,8 @@ function run(settings) {
307309
* Modify mdast to invoke callbacks when HTML commnts are
308310
* found.
309311
*
310-
* @param {MDAST} mdast
311-
* @param {Object?} options
312+
* @param {MDAST} mdast - Instance.
313+
* @param {Object?} [options] - Configuration.
312314
* @return {Function?}
313315
*/
314316
function attacher(mdast, options) {
@@ -338,7 +340,7 @@ function attacher(mdast, options) {
338340
* Reason for this is that **mdast** only allows a single
339341
* function to be `use`d once.
340342
*
341-
* @param {Object} options
343+
* @param {Object} options - Plugin configuration.
342344
* @return {Function}
343345
*/
344346
function wrapper(options) {
@@ -357,12 +359,12 @@ function wrapper(options) {
357359

358360
module.exports = wrapper;
359361

360-
},{"mdast-util-visit":2}],2:[function(require,module,exports){
362+
},{"unist-util-visit":2}],2:[function(require,module,exports){
361363
/**
362364
* @author Titus Wormer
363365
* @copyright 2015 Titus Wormer. All rights reserved.
364-
* @module mdast-util-visit
365-
* @fileoverview Utility to recursively walk over mdast nodes.
366+
* @module unist:util:visit
367+
* @fileoverview Utility to recursively walk over unist nodes.
366368
*/
367369

368370
'use strict';

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"index.js"
2525
],
2626
"devDependencies": {
27-
"browserify": "^10.0.0",
28-
"eslint": "^0.24.0",
27+
"browserify": "^11.0.0",
28+
"eslint": "^1.0.0",
2929
"esmangle": "^1.0.0",
3030
"istanbul": "^0.3.0",
31-
"jscs": "^1.0.0",
31+
"jscs": "^2.0.0",
3232
"jscs-jsdoc": "^1.0.0",
3333
"mdast": "^1.0.0",
3434
"mdast-github": "^0.3.0",

0 commit comments

Comments
 (0)