forked from csscomb/csscomb.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"excludeFiles": [ | ||
"node_modules/**" | ||
], | ||
"requireCurlyBraces": [ | ||
"else", | ||
"while", | ||
"do" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"catch" | ||
], | ||
"requireMultipleVarDecl": true, | ||
"disallowLeftStickedOperators": [ | ||
"?", | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"disallowRightStickedOperators": [ | ||
"?", | ||
"+", | ||
"/", | ||
"*", | ||
":", | ||
",", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"requireRightStickedOperators": ["!"], | ||
"requireLeftStickedOperators": [","], | ||
"disallowImplicitTypeConversion": [ | ||
"numeric", | ||
"boolean", | ||
"binary", | ||
"string" | ||
], | ||
"disallowKeywords": ["with"], | ||
"disallowMulipleLineBreaks": true, | ||
"disallowKeywordsOnNewLine": ["else", "catch"], | ||
"requireLineFeedAtFileEnd": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"requireParamTypes": true | ||
}, | ||
"requireSpacesInsideObjectBrackets": "all", | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpaceAfterObjectKeys": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module.exports = { | ||
options: { | ||
eqeqeq: true, | ||
evil: true, | ||
expr: true, | ||
forin: true, | ||
immed: true, | ||
indent: 4, | ||
latedef: true, | ||
maxdepth: 4, | ||
maxlen: 120, | ||
maxparams: 4, | ||
newcap: true, | ||
noarg: true, | ||
noempty: true, | ||
nonew: true, | ||
quotmark: 'single', | ||
trailing: true, | ||
undef: true, | ||
unused: true | ||
}, | ||
groups: { | ||
js: { | ||
options: { node: true }, | ||
includes: ['**/*.js'], | ||
excludes: ['node_modules/**/*.js'] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
require('../lib/cli'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Command line implementation for CSScomb | ||
* | ||
* Usage example: | ||
* ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]] | ||
*/ | ||
var fs = require('fs'), | ||
program = require('commander'); | ||
|
||
program | ||
.version(require('../package.json').version) | ||
.usage('[options] <file ...>') | ||
.option('-c, --config [path]', 'configuration file path') | ||
.parse(process.argv); | ||
|
||
var configPath = program.config || (process.cwd() + '/.csscomb.json'); | ||
|
||
/** | ||
* Trying to load config. | ||
* Custom config path can be specified using '-c' option. | ||
*/ | ||
if (fs.existsSync(configPath)) { | ||
var config = require(configPath); | ||
} else { | ||
console.log('Configuration file ' + configPath + ' was not found.'); | ||
/** | ||
* Quitting with 1 error code. | ||
*/ | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "csscomb", | ||
"description": "Tool for sorting CSS properties", | ||
"version": "0.0.0", | ||
"homepage": "http://csscomb.com/", | ||
"author": "Mikhail Troshev <[email protected]>", | ||
"repository": "https://github.com/mishanga/csscomb.js", | ||
"contributors": [ | ||
{ | ||
"name": "Slava Oliyanchuk", | ||
"email": "[email protected]", | ||
"url": "http://miripiruni.org/" | ||
}, | ||
{ | ||
"name": "Mikhail Troshev", | ||
"email": "[email protected]", | ||
"url": "http://mishanga.pro/" | ||
} | ||
], | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
}, | ||
"dependencies": { | ||
"commander": "1.1.1" | ||
}, | ||
"devDependencies": { | ||
"jshint-groups": "0.5.1", | ||
"jshint": "2.1.7", | ||
"jscs": "1.0.2" | ||
}, | ||
"bin": { | ||
"csscomb": "./bin/csscomb" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/.bin/jshint-groups; ./node_modules/.bin/jscs ." | ||
} | ||
} |