File tree Expand file tree Collapse file tree 5 files changed +26
-25
lines changed Expand file tree Collapse file tree 5 files changed +26
-25
lines changed Original file line number Diff line number Diff line change 1
- # editorconfig.org
2
1
root = true
3
2
4
3
[* ]
Original file line number Diff line number Diff line change 4
4
"bitwise" : true ,
5
5
"camelcase" : true ,
6
6
"curly" : true ,
7
- "eqeqeq" : true ,
8
7
"immed" : true ,
9
- "indent" : 4 ,
10
8
"newcap" : true ,
11
9
"noarg" : true ,
12
- "quotmark" : " single" ,
13
- "regexp" : true ,
14
10
"undef" : true ,
15
- "unused" : true ,
16
- "strict" : true ,
17
- "trailing" : true ,
18
- "smarttabs" : true
11
+ "unused" : " vars" ,
12
+ "strict" : true
19
13
}
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
'use strict' ;
3
3
var pkg = require ( './package.json' ) ;
4
- var githubMarkdownCss = require ( './index ' ) ;
5
- var input = process . argv [ 2 ] ;
4
+ var githubMarkdownCss = require ( './' ) ;
5
+ var argv = process . argv . slice ( 2 ) ;
6
6
7
7
function help ( ) {
8
- console . log ( pkg . description ) ;
9
- console . log ( '' ) ;
10
- console . log ( 'Usage' ) ;
11
- console . log ( ' $ github-markdown-css > <filename>' ) ;
8
+ console . log ( [
9
+ '' ,
10
+ ' ' + pkg . description ,
11
+ '' ,
12
+ ' Usage' ,
13
+ ' github-markdown-css > <filename>'
14
+ ] . join ( '\n' ) ) ;
12
15
}
13
16
14
- if ( process . argv . indexOf ( '-h' ) !== - 1 || process . argv . indexOf ( '--help' ) !== - 1 ) {
17
+ if ( argv . indexOf ( '--help' ) !== - 1 ) {
15
18
help ( ) ;
16
19
return ;
17
20
}
18
21
19
- if ( process . argv . indexOf ( '-v' ) !== - 1 || process . argv . indexOf ( '--version' ) !== - 1 ) {
22
+ if ( argv . indexOf ( '--version' ) !== - 1 ) {
20
23
console . log ( pkg . version ) ;
21
24
return ;
22
25
}
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ var uncss = require('uncss');
6
6
function getCss ( cb ) {
7
7
got ( 'https://github.com' , function ( err , data ) {
8
8
if ( err ) {
9
- return cb ( err ) ;
9
+ cb ( err ) ;
10
+ return ;
10
11
}
11
12
12
13
var ret = [ ] ;
@@ -17,7 +18,8 @@ function getCss(cb) {
17
18
} ) ;
18
19
19
20
if ( ret . length === 0 ) {
20
- return cb ( new Error ( 'Could not find GitHub stylesheets' ) ) ;
21
+ cb ( new Error ( 'Could not find GitHub stylesheets' ) ) ;
22
+ return ;
21
23
}
22
24
23
25
cb ( null , ret ) ;
@@ -29,7 +31,8 @@ function getRenderedFixture(cb) {
29
31
30
32
got ( url , function ( err , data ) {
31
33
if ( err ) {
32
- return cb ( err ) ;
34
+ cb ( err ) ;
35
+ return ;
33
36
}
34
37
35
38
var $ = cheerio . load ( data ) ;
@@ -103,12 +106,14 @@ function cleanupCss(str) {
103
106
module . exports = function ( cb ) {
104
107
getRenderedFixture ( function ( err , html ) {
105
108
if ( err ) {
106
- return cb ( err ) ;
109
+ cb ( err ) ;
110
+ return ;
107
111
}
108
112
109
113
getCss ( function ( err , stylesheets ) {
110
114
if ( err ) {
111
- return cb ( err ) ;
115
+ cb ( err ) ;
116
+ return ;
112
117
}
113
118
114
119
uncss ( html , {
Original file line number Diff line number Diff line change 4
4
"description" : " The minimal amount of CSS to replicate the GitHub Markdown style" ,
5
5
"license" : " MIT" ,
6
6
"repository" : " sindresorhus/github-markdown-css" ,
7
- "bin" : {
8
- "github-markdown-css" : " cli.js"
9
- },
10
7
"author" : {
11
8
"name" : " Sindre Sorhus" ,
12
9
"email" : " sindresorhus@gmail.com" ,
13
10
"url" : " http://sindresorhus.com"
14
11
},
12
+ "bin" : {
13
+ "github-markdown-css" : " cli.js"
14
+ },
15
15
"contributors" : [
16
16
{
17
17
"name" : " Benjamin Tan" ,
You can’t perform that action at this time.
0 commit comments