Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyganch committed Jul 11, 2016
1 parent 72c6994 commit 4f68f39
Show file tree
Hide file tree
Showing 34 changed files with 83 additions and 51 deletions.
15 changes: 10 additions & 5 deletions .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@
"requireSpaceBetweenArguments": true,
"requireSpacesInForStatement": true,
"validateIndentation": 2,
"validateJSDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true
},
"validateQuoteMarks": {
"mark": "'",
"escape": true
},
"jsDoc": {
"checkAnnotations": "closurecompiler",
"checkParamNames": true,
"checkRedundantParams": true,
"checkRedundantReturns": true,
"checkReturnTypes": true,
"checkTypes": true,
"requireParamTypes": true,
"requireReturnTypes": true
}
}
36 changes: 0 additions & 36 deletions .jshint-groups.js

This file was deleted.

5 changes: 4 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"eqeqeq": true,
"esnext": true,
"freeze": true,
"globals": {
"afterEach": false,
"beforeEach": false,
"describe": false,
"it": false
},
"esnext": true,
"node": true,
"strict": true,
"undef": true,
"unused": true,
"-W084": true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"babel": "^5.5.3",
"jscs": "1.13.1",
"jscs": "2.1.0",
"jshint": "2.8.0",
"mocha": "1.20.1"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ printf "\n\
----------------\n\
Running JSHint\n\
----------------\n\n"
test ./node_modules/.bin/jshint-groups
test ./node_modules/.bin/jshint ./src

printf "\n\
--------------\n\
Expand Down
2 changes: 2 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* Command line implementation for CSSComb
*
Expand Down
2 changes: 2 additions & 0 deletions src/csscomb.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let Comb = require('csscomb-core');
let gonzales = require('./gonzales');
let fs = require('fs');
Expand Down
2 changes: 2 additions & 0 deletions src/format.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = function(string) {
return string.replace(/\n\s+/gm, ' ');
};
5 changes: 4 additions & 1 deletion src/gonzales.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
// jscs:disable
// jscs:disable maximumLineLength

'use strict';

module.exports = require('../node_modules/csscomb-core/node_modules/gonzales-pe');
7 changes: 5 additions & 2 deletions src/options/always-semicolon.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

let option = {
Expand Down Expand Up @@ -29,8 +31,9 @@ let option = {

/**
* Checks ast for code style errors.
*
* @param {Node} ast
* @return {Array} List of found errors.
* @return {Array?} List of found errors.
*/
lint(ast) {
var errors = [];
Expand Down Expand Up @@ -120,7 +123,7 @@ let option = {
/**
* Detects the value of this option in ast.
* @param {Node} ast
* @return {Array} List of detected values
* @return {Array?} List of detected values
*/
detect(ast) {
var detected = [];
Expand Down
2 changes: 2 additions & 0 deletions src/options/block-indent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let option = {
/**
* Option's name as it's used in config.
Expand Down
2 changes: 2 additions & 0 deletions src/options/color-case.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let option = {
/**
* Option's name as it's used in config.
Expand Down
2 changes: 2 additions & 0 deletions src/options/color-shorthand.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let option = {
/**
* Option's name as it's used in config.
Expand Down
2 changes: 2 additions & 0 deletions src/options/element-case.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let option = {
/**
* Option's name as it's used in config.
Expand Down
2 changes: 2 additions & 0 deletions src/options/eof-newline.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

let gonzales = require('../gonzales');

let option = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/leading-zero.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
name: 'leading-zero',

Expand Down
2 changes: 2 additions & 0 deletions src/options/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
name: 'quotes',

Expand Down
2 changes: 2 additions & 0 deletions src/options/remove-empty-rulesets.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = (function() {
function processNode(node) {
removeEmptyRulesets(node);
Expand Down
2 changes: 2 additions & 0 deletions src/options/sort-order-fallback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
name: 'sort-order-fallback',

Expand Down
2 changes: 2 additions & 0 deletions src/options/sort-order.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-after-colon.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-after-combinator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-after-opening-brace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-after-selector-delimiter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-before-closing-brace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = (function() {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-before-colon.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-before-combinator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-before-opening-brace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = (function() {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-before-selector-delimiter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/options/space-between-declarations.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = (function() {
Expand Down
2 changes: 2 additions & 0 deletions src/options/strip-spaces.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = (function() {
/**
* Trim trailing spaces on each line.
Expand Down
2 changes: 2 additions & 0 deletions src/options/tab-size.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
name: 'tab-size',

Expand Down
2 changes: 2 additions & 0 deletions src/options/unitless-zero.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
name: 'unitless-zero',

Expand Down
10 changes: 6 additions & 4 deletions src/options/vendor-prefix-align.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var gonzales = require('../gonzales');

module.exports = (function() {
Expand Down Expand Up @@ -214,8 +216,8 @@ module.exports = (function() {
/**
* Updates dict which contains info about items align.
*
* @param {Object} info,
* @param {Object} dict,
* @param {Object} info
* @param {Object} dict
*/
function updateDict(info, dict) {
if (info.prefixLength === 0 && info.extra === 0) return;
Expand All @@ -237,8 +239,8 @@ module.exports = (function() {
/**
* Returns string with correct number of spaces for info.baseName property.
*
* @param {Object} info,
* @param {Object} dict,
* @param {Object} info
* @param {Object} dict
* @param {String} whitespaceNode
* @returns {String}
*/
Expand Down

0 comments on commit 4f68f39

Please sign in to comment.