Skip to content

Commit a6346a1

Browse files
committed
switched to eslint, reverted to es5, restructured
1 parent 4ea019b commit a6346a1

File tree

9 files changed

+282
-267
lines changed

9 files changed

+282
-267
lines changed

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "airbnb/base",
3+
"rules": {
4+
"no-console": 0,
5+
"no-var": 0,
6+
"func-names": 0,
7+
"object-shorthand": 0,
8+
"camelcase": 0,
9+
"new-cap": 0
10+
}
11+
}

.jshintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
language: node_js
22
node_js:
3-
- "5.1"
4-
- "5.0"
5-
- "4.2"
6-
- "4.1"
7-
- "4.0"
3+
- "5.1"
4+
- "5.0"
5+
- "4.2"
6+
- "4.1"
7+
- "4.0"
8+
- "0.12"

index.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
var program = require('commander');
6+
var W3CValidator = require('./lib/W3CValidator.js');
7+
var chalk = require('chalk');
8+
var pkg = require('./package.json');
9+
10+
program.version(pkg.version)
11+
.usage('[options] <url>')
12+
.option('-l, --log', 'log errors in a text file')
13+
.option('-m, --max <n>', 'max URLs to crawl')
14+
.option('-q, --query', 'consider query string')
15+
.option('-v, --verbose', 'show error details')
16+
.parse(process.argv);
17+
18+
if (!program.args[0]) {
19+
program.help();
20+
process.exit();
21+
}
22+
23+
require('find-java-home')(function (err, java_home) {
24+
var validator;
25+
if (!err) {
26+
validator = new W3CValidator(program.args[0], java_home);
27+
validator.start();
28+
} else {
29+
console.error(chalk.red.bold('Error: Java is required to use w3c-validator!'));
30+
process.exit(1);
31+
}
32+
});

0 commit comments

Comments
 (0)