Skip to content

Commit

Permalink
Some prepares
Browse files Browse the repository at this point in the history
  • Loading branch information
mishanga committed Aug 3, 2013
1 parent 6f1c271 commit 4fe2b1d
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .csscomb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
73 changes: 73 additions & 0 deletions .jscs.json
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
}
29 changes: 29 additions & 0 deletions .jshint-groups.js
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']
}
}
};
2 changes: 2 additions & 0 deletions bin/csscomb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/cli');
30 changes: 30 additions & 0 deletions lib/cli.js
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);
}
37 changes: 37 additions & 0 deletions package.json
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 ."
}
}

0 comments on commit 4fe2b1d

Please sign in to comment.