git.iko.soy/typeable/remark-validate-links
on main help sign in
Update eslint, jscs style guidelines
commitf9cba900a63c6db0578ce6d82ab0ec6d6dd7feca authorTitus Wormer <tituswormer@gmail.com> dateSat 26 Dec 2015, 19:09 (11 years ago) parentef76179
4 files changed+35−142
.eslintrc−3 .jscs.json+14−120 index.js+4−2 test/index.js+17−17
.eslintrc−3
@@ -1,8 +1,5 @@
11{
22 "extends": "eslint:recommended",
3− "env": {
4− "node": true
5− },
63 "rules": {
74 "quotes": [2, "single"]
85 }
.jscs.json+14−120
@@ -3,8 +3,19 @@
33 "coverage/",
44 "node_modules/"
55 ],
6+ "preset": "yandex",
7+ "requireQuotedKeysInObjects": true,
8+ "disallowQuotedKeysInObjects": false,
9+ "maximumLineLength": {
10+ "value": 79,
11+ "allExcept": [
12+ "regex",
13+ "urlComments"
14+ ]
15+ },
616 "jsDoc": {
717 "checkAnnotations": "jsdoc3",
18+ "checkParamExistence": true,
819 "checkParamNames": true,
920 "checkRedundantAccess": true,
1021 "checkRedundantParams": true,
@@ -14,126 +25,9 @@
1425 "enforceExistence": true,
1526 "requireHyphenBeforeDescription": true,
1627 "requireNewlineAfterDescription": true,
17− "requireParamTypes": true,
1828 "requireParamDescription": true,
29+ "requireParamTypes": true,
30+ "requireReturnDescription": true,
1931 "requireReturnTypes": true
20− },
21− "requireCurlyBraces": [
22− "if",
23− "else",
24− "for",
25− "while",
26− "do",
27− "try",
28− "catch"
29− ],
30− "requireSpaceAfterKeywords": [
31− "if",
32− "else",
33− "for",
34− "while",
35− "do",
36− "switch",
37− "return",
38− "try",
39− "catch"
40− ],
41− "requireSpaceBeforeBlockStatements": true,
42− "requireParenthesesAroundIIFE": true,
43− "requireSpacesInConditionalExpression": true,
44− "requireSpacesInFunctionExpression": {
45− "beforeOpeningCurlyBrace": true
46− },
47− "requireSpacesInAnonymousFunctionExpression": {
48− "beforeOpeningRoundBrace": true,
49− "beforeOpeningCurlyBrace": true
50− },
51− "requireSpacesInNamedFunctionExpression": {
52− "beforeOpeningRoundBrace": true,
53− "beforeOpeningCurlyBrace": true
54− },
55− "requireBlocksOnNewline": true,
56− "disallowEmptyBlocks": true,
57− "disallowSpacesInsideObjectBrackets": true,
58− "disallowSpacesInsideArrayBrackets": true,
59− "disallowSpacesInsideParentheses": true,
60− "requireSpacesInsideObjectBrackets": "all",
61− "disallowDanglingUnderscores": true,
62− "disallowSpaceAfterObjectKeys": true,
63− "requireCommaBeforeLineBreak": true,
64− "requireOperatorBeforeLineBreak": [
65− "?",
66− "+",
67− "-",
68− "/",
69− "*",
70− "=",
71− "==",
72− "===",
73− "!=",
74− "!==",
75− ">",
76− ">=",
77− "<",
78− "<="
79− ],
80− "requireSpaceBeforeBinaryOperators": [
81− "+",
82− "-",
83− "/",
84− "*",
85− "=",
86− "==",
87− "===",
88− "!=",
89− "!=="
90− ],
91− "requireSpaceAfterBinaryOperators": [
92− "+",
93− "-",
94− "/",
95− "*",
96− "=",
97− "==",
98− "===",
99− "!=",
100− "!=="
101− ],
102− "disallowSpaceAfterPrefixUnaryOperators": [
103− "++",
104− "--",
105− "+",
106− "-",
107− "~",
108− "!"
109− ],
110− "disallowSpaceBeforePostfixUnaryOperators": [
111− "++",
112− "--"
113− ],
114− "disallowImplicitTypeConversion": [
115− "numeric",
116− "boolean",
117− "binary",
118− "string"
119− ],
120− "requireCamelCaseOrUpperCaseIdentifiers": true,
121− "disallowKeywords": [
122− "with"
123− ],
124− "disallowMultipleLineStrings": true,
125− "disallowMultipleLineBreaks": true,
126− "validateLineBreaks": "LF",
127− "validateQuoteMarks": "'",
128− "disallowMixedSpacesAndTabs": true,
129− "disallowTrailingWhitespace": true,
130− "disallowTrailingComma": true,
131− "disallowKeywordsOnNewLine": [
132− "else"
133− ],
134− "requireLineFeedAtFileEnd": true,
135− "requireCapitalizedConstructors": true,
136− "safeContextKeyword": "self",
137− "requireDotNotation": true,
138− "disallowYodaConditions": true
32+ }
13933}
index.js+4−2
@@ -8,6 +8,8 @@
88
99'use strict';
1010
11+/* eslint-env node */
12+
1113/*
1214 * Dependencies.
1315 */
@@ -266,7 +268,7 @@ function gatherReferences(file, project) {
266268 *
267269 * gather(file).done() // {}
268270 *
269− * @return {Function}
271+ * @return {Function} - Gatherer.
270272 */
271273function gatherExposedFactory() {
272274 var cache = {};
@@ -464,7 +466,7 @@ function completerFactory(project) {
464466 * project, with a `user` and `repo` property
465467 * (optional).
466468 * @param {FileSet} fileSet - Set of virtual files.
467− * @return {function(ast, file)}
469+ * @return {function(ast, file)} - Transformer.
468470 */
469471function transformerFactory(project, fileSet) {
470472 /**
test/index.js+17−17
@@ -63,7 +63,7 @@ process.chdir(path.resolve(process.cwd(), 'test', 'fixtures'));
6363
6464test.onFinish(function () {
6565 process.chdir(path.resolve(process.cwd(), '..', '..'));
66−})
66+});
6767
6868test('remark-validate-links', function (t) {
6969 // t.plan(1);
@@ -132,7 +132,7 @@ test('remark-validate-links', function (t) {
132132
133133 st.end();
134134 });
135− })
135+ });
136136
137137 t.test('should work when not all files are given', function (st) {
138138 assertion({
@@ -176,7 +176,7 @@ test('remark-validate-links', function (t) {
176176
177177 st.end();
178178 });
179− })
179+ });
180180
181181 t.test('should work when all files are given', function (st) {
182182 assertion({
@@ -187,10 +187,10 @@ test('remark-validate-links', function (t) {
187187 'color': false,
188188 'detectRC': false,
189189 'detectIgnore': false,
190− 'plugins': [
191− '../../../node_modules/remark-slug',
192− '../../../index.js'
193− ]
190+ 'plugins': [
191+ '../../../node_modules/remark-slug',
192+ '../../../index.js'
193+ ]
194194 }, function (err, res) {
195195 st.ifErr(err);
196196
@@ -245,10 +245,10 @@ test('remark-validate-links', function (t) {
245245 'color': false,
246246 'detectRC': false,
247247 'detectIgnore': false,
248− 'plugins': [
249− '../../../node_modules/remark-slug',
250− '../../../index.js'
251− ]
248+ 'plugins': [
249+ '../../../node_modules/remark-slug',
250+ '../../../index.js'
251+ ]
252252 }, function (err, res) {
253253 st.ifErr(err);
254254
@@ -376,10 +376,10 @@ test('remark-validate-links', function (t) {
376376 'color': false,
377377 'detectRC': false,
378378 'detectIgnore': false,
379− 'plugins': [
380− '../../../node_modules/remark-slug',
381− '../../../index.js'
382− ]
379+ 'plugins': [
380+ '../../../node_modules/remark-slug',
381+ '../../../index.js'
382+ ]
383383 }, function (err, res) {
384384 fs.unlinkSync('./package.json');
385385
@@ -478,8 +478,8 @@ test('remark-validate-links', function (t) {
478478 res.stderr,
479479 [
480480 'suggestions.md',
481− ' 3:22-3:37 warning Link to unknown heading: `helloo`. ' +
482− 'Did you mean `hello`',
481+ ' 3:22-3:37 warning Link to unknown heading: ' +
482+ '`helloo`. Did you mean `hello`',
483483 ' 7:17-7:40 warning Link to unknown heading in ' +
484484 '`example.md`: `fiiiles`. Did you mean `files`',
485485 '',