Skip to content

Commit 4fe2b1d

Browse files
committed
Some prepares
1 parent 6f1c271 commit 4fe2b1d

7 files changed

Lines changed: 174 additions & 0 deletions

File tree

.csscomb.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.jscs.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"excludeFiles": [
3+
"node_modules/**"
4+
],
5+
"requireCurlyBraces": [
6+
"else",
7+
"while",
8+
"do"
9+
],
10+
"requireSpaceAfterKeywords": [
11+
"if",
12+
"else",
13+
"for",
14+
"while",
15+
"do",
16+
"switch",
17+
"return",
18+
"catch"
19+
],
20+
"requireMultipleVarDecl": true,
21+
"disallowLeftStickedOperators": [
22+
"?",
23+
"+",
24+
"-",
25+
"/",
26+
"*",
27+
"=",
28+
"==",
29+
"===",
30+
"!=",
31+
"!==",
32+
">",
33+
">=",
34+
"<",
35+
"<="
36+
],
37+
"disallowRightStickedOperators": [
38+
"?",
39+
"+",
40+
"/",
41+
"*",
42+
":",
43+
",",
44+
"=",
45+
"==",
46+
"===",
47+
"!=",
48+
"!==",
49+
">",
50+
">=",
51+
"<",
52+
"<="
53+
],
54+
"requireRightStickedOperators": ["!"],
55+
"requireLeftStickedOperators": [","],
56+
"disallowImplicitTypeConversion": [
57+
"numeric",
58+
"boolean",
59+
"binary",
60+
"string"
61+
],
62+
"disallowKeywords": ["with"],
63+
"disallowMulipleLineBreaks": true,
64+
"disallowKeywordsOnNewLine": ["else", "catch"],
65+
"requireLineFeedAtFileEnd": true,
66+
"validateJSDoc": {
67+
"checkParamNames": true,
68+
"requireParamTypes": true
69+
},
70+
"requireSpacesInsideObjectBrackets": "all",
71+
"disallowSpacesInsideArrayBrackets": true,
72+
"disallowSpaceAfterObjectKeys": true
73+
}

.jshint-groups.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
options: {
3+
eqeqeq: true,
4+
evil: true,
5+
expr: true,
6+
forin: true,
7+
immed: true,
8+
indent: 4,
9+
latedef: true,
10+
maxdepth: 4,
11+
maxlen: 120,
12+
maxparams: 4,
13+
newcap: true,
14+
noarg: true,
15+
noempty: true,
16+
nonew: true,
17+
quotmark: 'single',
18+
trailing: true,
19+
undef: true,
20+
unused: true
21+
},
22+
groups: {
23+
js: {
24+
options: { node: true },
25+
includes: ['**/*.js'],
26+
excludes: ['node_modules/**/*.js']
27+
}
28+
}
29+
};

bin/csscomb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('../lib/cli');

lib/cli.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Command line implementation for CSScomb
3+
*
4+
* Usage example:
5+
* ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]]
6+
*/
7+
var fs = require('fs'),
8+
program = require('commander');
9+
10+
program
11+
.version(require('../package.json').version)
12+
.usage('[options] <file ...>')
13+
.option('-c, --config [path]', 'configuration file path')
14+
.parse(process.argv);
15+
16+
var configPath = program.config || (process.cwd() + '/.csscomb.json');
17+
18+
/**
19+
* Trying to load config.
20+
* Custom config path can be specified using '-c' option.
21+
*/
22+
if (fs.existsSync(configPath)) {
23+
var config = require(configPath);
24+
} else {
25+
console.log('Configuration file ' + configPath + ' was not found.');
26+
/**
27+
* Quitting with 1 error code.
28+
*/
29+
process.exit(1);
30+
}

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "csscomb",
3+
"description": "Tool for sorting CSS properties",
4+
"version": "0.0.0",
5+
"homepage": "http://csscomb.com/",
6+
"author": "Mikhail Troshev <mishanga@yandex-team.ru>",
7+
"repository": "https://github.com/mishanga/csscomb.js",
8+
"contributors": [
9+
{
10+
"name": "Slava Oliyanchuk",
11+
"email": "miripiruni@gmail.com",
12+
"url": "http://miripiruni.org/"
13+
},
14+
{
15+
"name": "Mikhail Troshev",
16+
"email": "mishanga@yandex-team.ru",
17+
"url": "http://mishanga.pro/"
18+
}
19+
],
20+
"engines": {
21+
"node": ">= 0.8.0"
22+
},
23+
"dependencies": {
24+
"commander": "1.1.1"
25+
},
26+
"devDependencies": {
27+
"jshint-groups": "0.5.1",
28+
"jshint": "2.1.7",
29+
"jscs": "1.0.2"
30+
},
31+
"bin": {
32+
"csscomb": "./bin/csscomb"
33+
},
34+
"scripts": {
35+
"test": "./node_modules/.bin/jshint-groups; ./node_modules/.bin/jscs ."
36+
}
37+
}

0 commit comments

Comments
 (0)