Skip to content

Commit

Permalink
Update code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 17, 2016
1 parent 30a0d08 commit 8bb799a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 128 deletions.
4 changes: 0 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"browser": true
},
"rules": {
"quotes": [2, "single"]
}
Expand Down
136 changes: 14 additions & 122 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"excludeFiles": [
"build/",
"components/",
"coverage/",
"node_modules/",
"build.js",
"mdast-util-heading-style.js",
"mdast-util-heading-style.min.js"
],
"preset": "yandex",
"requireQuotedKeysInObjects": true,
"disallowQuotedKeysInObjects": false,
"maximumLineLength": {
"value": 79,
"allExcept": [
"regex",
"urlComments"
]
},
"jsDoc": {
"checkAnnotations": "jsdoc3",
"checkParamExistence": true,
"checkParamNames": true,
"checkRedundantAccess": true,
"checkRedundantParams": true,
Expand All @@ -19,126 +28,9 @@
"enforceExistence": true,
"requireHyphenBeforeDescription": true,
"requireNewlineAfterDescription": true,
"requireParamTypes": true,
"requireParamDescription": true,
"requireParamTypes": true,
"requireReturnDescription": true,
"requireReturnTypes": true
},
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireBlocksOnNewline": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideObjectBrackets": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowDanglingUnderscores": true,
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"requireOperatorBeforeLineBreak": [
"?",
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"requireSpaceBeforeBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"requireSpaceAfterBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"disallowSpaceAfterPrefixUnaryOperators": [
"++",
"--",
"+",
"-",
"~",
"!"
],
"disallowSpaceBeforePostfixUnaryOperators": [
"++",
"--"
],
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
"requireCamelCaseOrUpperCaseIdentifiers": true,
"disallowKeywords": [
"with"
],
"disallowMultipleLineStrings": true,
"disallowMultipleLineBreaks": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": [
"else"
],
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"safeContextKeyword": "self",
"requireDotNotation": true,
"disallowYodaConditions": true
}
}
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer. All rights reserved.
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:util:heading-style
* @fileoverview Utility to get the style of an mdast heading.
*/

'use strict';

/* eslint-env node */

/**
* Get the probable style of an atx-heading, depending on
* preferred style.
Expand Down
5 changes: 4 additions & 1 deletion mdast-util-heading-style.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mdastUtilHeadingStyle = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer. All rights reserved.
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:util:heading-style
* @fileoverview Utility to get the style of an mdast heading.
*/

'use strict';

/* eslint-env node */

/**
* Get the probable style of an atx-heading, depending on
* preferred style.
Expand Down
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:util:heading-style
* @fileoverview Test suit for `mdast-util-heading-style`.
*/

'use strict';

/* eslint-env node */

'use strict';

/* eslint-env node */
Expand Down

0 comments on commit 8bb799a

Please sign in to comment.