Skip to content

Commit 2920dd0

Browse files
committed
Update code-style guidelines
1 parent 73c599a commit 2920dd0

File tree

4 files changed

+27
-128
lines changed

4 files changed

+27
-128
lines changed

.eslintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"extends": "eslint:recommended",
3-
"env": {
4-
"node": true,
5-
"browser": true
6-
},
73
"rules": {
84
"quotes": [2, "single"]
95
}

.jscs.json

Lines changed: 14 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
{
22
"excludeFiles": [
3-
"build/",
43
"components/",
54
"coverage/",
65
"node_modules/",
7-
"build.js",
86
"mdast-util-to-string.js",
97
"mdast-util-to-string.min.js"
108
],
9+
"preset": "yandex",
10+
"requireQuotedKeysInObjects": true,
11+
"disallowQuotedKeysInObjects": false,
12+
"maximumLineLength": {
13+
"value": 79,
14+
"allExcept": [
15+
"regex",
16+
"urlComments"
17+
]
18+
},
1119
"jsDoc": {
1220
"checkAnnotations": "jsdoc3",
21+
"checkParamExistence": true,
1322
"checkParamNames": true,
1423
"checkRedundantAccess": true,
1524
"checkRedundantParams": true,
@@ -19,126 +28,9 @@
1928
"enforceExistence": true,
2029
"requireHyphenBeforeDescription": true,
2130
"requireNewlineAfterDescription": true,
22-
"requireParamTypes": true,
2331
"requireParamDescription": true,
32+
"requireParamTypes": true,
33+
"requireReturnDescription": true,
2434
"requireReturnTypes": true
25-
},
26-
"requireCurlyBraces": [
27-
"if",
28-
"else",
29-
"for",
30-
"while",
31-
"do",
32-
"try",
33-
"catch"
34-
],
35-
"requireSpaceAfterKeywords": [
36-
"if",
37-
"else",
38-
"for",
39-
"while",
40-
"do",
41-
"switch",
42-
"return",
43-
"try",
44-
"catch"
45-
],
46-
"requireSpaceBeforeBlockStatements": true,
47-
"requireParenthesesAroundIIFE": true,
48-
"requireSpacesInConditionalExpression": true,
49-
"requireSpacesInFunctionExpression": {
50-
"beforeOpeningCurlyBrace": true
51-
},
52-
"requireSpacesInAnonymousFunctionExpression": {
53-
"beforeOpeningRoundBrace": true,
54-
"beforeOpeningCurlyBrace": true
55-
},
56-
"requireSpacesInNamedFunctionExpression": {
57-
"beforeOpeningRoundBrace": true,
58-
"beforeOpeningCurlyBrace": true
59-
},
60-
"requireBlocksOnNewline": true,
61-
"disallowEmptyBlocks": true,
62-
"disallowSpacesInsideObjectBrackets": true,
63-
"disallowSpacesInsideArrayBrackets": true,
64-
"disallowSpacesInsideParentheses": true,
65-
"requireSpacesInsideObjectBrackets": "all",
66-
"disallowDanglingUnderscores": true,
67-
"disallowSpaceAfterObjectKeys": true,
68-
"requireCommaBeforeLineBreak": true,
69-
"requireOperatorBeforeLineBreak": [
70-
"?",
71-
"+",
72-
"-",
73-
"/",
74-
"*",
75-
"=",
76-
"==",
77-
"===",
78-
"!=",
79-
"!==",
80-
">",
81-
">=",
82-
"<",
83-
"<="
84-
],
85-
"requireSpaceBeforeBinaryOperators": [
86-
"+",
87-
"-",
88-
"/",
89-
"*",
90-
"=",
91-
"==",
92-
"===",
93-
"!=",
94-
"!=="
95-
],
96-
"requireSpaceAfterBinaryOperators": [
97-
"+",
98-
"-",
99-
"/",
100-
"*",
101-
"=",
102-
"==",
103-
"===",
104-
"!=",
105-
"!=="
106-
],
107-
"disallowSpaceAfterPrefixUnaryOperators": [
108-
"++",
109-
"--",
110-
"+",
111-
"-",
112-
"~",
113-
"!"
114-
],
115-
"disallowSpaceBeforePostfixUnaryOperators": [
116-
"++",
117-
"--"
118-
],
119-
"disallowImplicitTypeConversion": [
120-
"numeric",
121-
"boolean",
122-
"binary",
123-
"string"
124-
],
125-
"requireCamelCaseOrUpperCaseIdentifiers": true,
126-
"disallowKeywords": [
127-
"with"
128-
],
129-
"disallowMultipleLineStrings": true,
130-
"disallowMultipleLineBreaks": true,
131-
"validateLineBreaks": "LF",
132-
"validateQuoteMarks": "'",
133-
"disallowMixedSpacesAndTabs": true,
134-
"disallowTrailingWhitespace": true,
135-
"disallowTrailingComma": true,
136-
"disallowKeywordsOnNewLine": [
137-
"else"
138-
],
139-
"requireLineFeedAtFileEnd": true,
140-
"requireCapitalizedConstructors": true,
141-
"safeContextKeyword": "self",
142-
"requireDotNotation": true,
143-
"disallowYodaConditions": true
35+
}
14436
}

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* @author Titus Wormer
3-
* @copyright 2015 Titus Wormer. All rights reserved.
3+
* @copyright 2015 Titus Wormer
4+
* @license MIT
45
* @module mdast:util:to-string
5-
* @fileoverview Utility to get the text value of a node.
6+
* @fileoverview Utility to get the plain text content of a node.
67
*/
78

89
'use strict';
910

11+
/* eslint-env node */
12+
1013
/**
1114
* Get the value of `node`. Checks, `value`,
1215
* `alt`, and `title`, in that order.

test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @author Titus Wormer
3+
* @copyright 2015 Titus Wormer
4+
* @license MIT
5+
* @module mdast:util:to-string
6+
* @fileoverview Test suite for `mdast-util-to-string`.
7+
*/
8+
19
'use strict';
210

311
/* eslint-env node */

0 commit comments

Comments
 (0)