8000 tweaks · suskycode/github-markdown-css@8f10b45 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f10b45

Browse files
committed
tweaks
1 parent 1c2aacc commit 8f10b45

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# editorconfig.org
21
root = true
32

43
[*]

.jshintrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
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
}

cli.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
#!/usr/bin/env node
22
'use strict';
33
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);
66

77
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'));
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
}

index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var uncss = require('uncss');
66
function 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 8000 -
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) {
103106
module.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, {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
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",

0 commit comments

Comments
 (0)
0