Skip to content
Browse files

Merge branch 'refs/heads/master' of

https://as-jpolo@github.com/as-jpolo/node-lint.git
  • Loading branch information...
2 parents f3d7859 + 270dc26 commit 6ee659861a9ed53156bf49ae25594edb0f842e86 as-jpolo committed Apr 15, 2011
Showing with 35 additions and 39 deletions.
  1. +29 −34 bin/node-lint
  2. +2 −1 lib/lint/formatter/cli.js
  3. +3 −3 lib/lint/parser.js
  4. +1 −1 package.json
View
63 bin/node-lint
@@ -1,54 +1,49 @@
#!/usr/bin/env node
-var util = require(process.binding('natives').util ? 'util' : 'sys');
-var fs = require('fs');
-var path = require('path');
-var ROOT_PATH, LIB_PATH;
+/*jslint nodejs:true, indent:4 */
+var util = require(process.binding('natives').util ? 'util' : 'sys'),
+ fs = require('fs'),
+ path = require('path');
//Build path
-ROOT_PATH = path.dirname(__dirname);
-LIB_PATH = path.join(path.dirname(__dirname), 'lib');
+var VERSION = '1.0.0',
+ ROOT_PATH = path.dirname(__dirname),
+ LIB_PATH = path.join(path.dirname(__dirname), 'lib');
require.paths.unshift(LIB_PATH);
//Include lint library
-var lint = require('lint');
-var Launcher = lint.Launcher;
-
-
-
-
-var usage, args, positionals, launcher, options, configFile;
+var lint = require('lint'),
+ Launcher = lint.Launcher;
//called as main executable
+var usage = "Usage: " + process.ARGV[0] + " file.js [dir1 file2 dir2 ...] [options]\n" +
+ "Options:\n\n" +
+ " --config=FILE the path to a JSON file with JSLINT options\n" +
+ " --formatter=FILE optional path to a /dir/dir/file.hs file to customize the output\n" +
+ " --no-colors disable colors\n" +
+ " --silent disable console output\n" +
+ " --pretty enable pretty print for some format (XML, etc)\n" +
+ " -h, --help display this help and exit\n" +
+ " -v, --version output version information and exit",
+ args = process.ARGV.splice(2), arg,
+ positionals = [],
+ options = {
+ formatter: {
+ },
+ parser: {
+ }
+ },
+ configFile = process.env.NODELINT_CONFIG_FILE || path.join(__dirname, '..', 'etc', 'config.json'),
+ launcher = new Launcher();
-usage = "Usage: " + process.ARGV[0] + " file.js [dir1 file2 dir2 ...] [options]\n" +
-"Options:\n\n" +
-" --config=FILE the path to a JSON file with JSLINT options\n" +
-" --formatter=FILE optional path to a /dir/dir/file.hs file to customize the output\n" +
-" -h, --help display this help and exit\n" +
-" -v, --version output version information and exit";
-args = process.ARGV.splice(2);
-positionals = [];
-options = {
- formatter: {
- },
- parser: {
- }
-};
-configFile = process.env.NODELINT_CONFIG_FILE || path.join(__dirname, '..', 'etc', 'config.json');
-
-launcher = new Launcher();
while (args.length !== 0) {
arg = args.shift();
switch (arg) {
case '-v':
case '--version':
- var content, pkg;
- content = fs.readFileSync(path.join(__filename, '..', '..', '..', 'package.json'), 'utf8');
- pkg = JSON.parse(content);
- util.puts(pkg.version);
+ util.puts(VERSION);
process.exit(0);
break;
case '-h':
View
3 lib/lint/formatter/cli.js
@@ -97,6 +97,7 @@ function Formatter(options) {
'text-decoration' : []
},
'file': {
+ 'font': null,
'font-weight' : 'bold',
'text-decoration' : ['underline']
},
@@ -131,7 +132,7 @@ function Formatter(options) {
'error-evidence': {
'font-weight' : 'bold',
- 'color' : 'yellow'
+ 'color' : 'blue'
},
'error-reason': {
'font-style' : 'italic'
View
6 lib/lint/parser.js
@@ -64,15 +64,15 @@ Parser.CONFIG = {
"eqeqeq": true, // if === should be required
//"es5": true, // if ES5 syntax should be allowed
"evil": false, // if eval should be allowed
- //"forin": false, // if for in statements must filter
+ "forin": false, // if for in statements must filter
//"fragment": false, // if HTML fragments should be allowed
"immed": true, // if immediate invocations must be wrapped in parens
//"laxbreak": false, // if line breaks should not be checked
//"newcap": true, // if constructor names must be capitalized
"nomen": false, // if names should be checked
//"on": false, // if HTML event handlers should be allowed
- //"onevar": true, // if only one var statement per function should be allowed
- //"passfail": false, // if the scan should stop on first error
+ "onevar": true, // if only one var statement per function should be allowed
+ "passfail": false, // if the scan should stop on first error
"plusplus": true, // if increment/decrement should not be allowed
"regexp": true, // if the . should not be allowed in regexp literals
//"rhino": false, // if the Rhino environment globals should be predefined
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "lint",
"description": "This package provide lint validation library + node-lint command line tool allows you to check for problems using JSLint. You can specify your own --config file to use alternate JSLint options and your own --formatter file if you want to customize the generated output.",
- "version": "0.2.2",
+ "version": "1.0.1",
"homepage": "https://github.com/as-jpolo/node-lint",
"author": "tav <tav@espians.com> (http://tav.espians.com)",
"contributors": [

0 comments on commit 6ee6598

Please sign in to comment.
Something went wrong with that request. Please try again.