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
21root = true
32
43[* ]
Original file line number Diff line number Diff line change 44 "bitwise" : true ,
55 "camelcase" : true ,
66 "curly" : true ,
7- "eqeqeq" : true ,
87 "immed" : true ,
9- "indent" : 4 ,
108 "newcap" : true ,
119 "noarg" : true ,
12- "quotmark" : " single" ,
13- "regexp" : true ,
1410 "undef" : true ,
15- "unused" : true ,
16- "strict" : true ,
17- "trailing" : true ,
18- "smarttabs" : true
11+ "unused" : " vars" ,
12+ "strict" : true
1913}
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22'use strict' ;
33var 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 ) ;
66
77function 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' ) ) ;
1215}
1316
14- if ( process . argv . indexOf ( '-h' ) !== - 1 || process . argv . indexOf ( '--help' ) !== - 1 ) {
17+ if ( argv . indexOf ( '--help' ) !== - 1 ) {
1518 help ( ) ;
1619 return ;
1720}
1821
19 - if ( process . argv . indexOf ( '-v' ) !== - 1 || process . argv . indexOf ( '--version' ) !== - 1 ) {
22+ if ( argv . indexOf ( '--version' ) !== - 1 ) {
2023 console . log ( pkg . version ) ;
2124 return ;
2225}
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ var uncss = require('uncss');
66function getCss ( cb ) {
77 got ( 'https://github.com' , function ( err , data ) {
88 if ( err ) {
9- return cb ( err ) ;
9+ cb ( err ) ;
10+ return ;
1011 }
1112
1213 var ret = [ ] ;
@@ -17,7 +18,8 @@ function getCss(cb) {
1718 } ) ;
1819
1920 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 ;
2123 }
2224
2325 cb ( null , ret ) ;
@@ -29,7 +31,8 @@ function getRenderedFixture(cb) {
2931
3032 got ( url , function ( err , data ) {
3133 if ( err ) {
32- return cb ( err ) ;
34+ cb ( err ) ;
35+ return ;
3336 }
3437
3538 var $ = cheerio . load ( data ) ;
@@ -103,12 +106,14 @@ function cleanupCss(str) {
103106module . exports = function ( cb ) {
104107 getRenderedFixture ( function ( err , html ) {
105108 if ( err ) {
106- return cb ( err ) ;
109+ cb ( err ) ;
110+ return ;
107111 }
108112
109113 getCss ( function ( err , stylesheets ) {
110114 if ( err ) {
111- return cb ( err ) ;
115+ cb ( err ) ;
116+ return ;
112117 }
113118
114119 uncss ( html , {
Original file line number Diff line number Diff line change 44 "description" : " The minimal amount of CSS to replicate the GitHub Markdown style" ,
55 "license" : " MIT" ,
66 "repository" : " sindresorhus/github-markdown-css" ,
7- "bin" : {
8- "github-markdown-css" : " cli.js"
9- },
107 "author" : {
118 "name" : " Sindre Sorhus" ,
129 "email" : " sindresorhus@gmail.com" ,
1310 "url" : " http://sindresorhus.com"
1411 },
12+ "bin" : {
13+ "github-markdown-css" : " cli.js"
14+ },
1515 "contributors" : [
1616 {
1717 "name" : " Benjamin Tan" ,
You can’t perform that action at this time.
0 commit comments