Skip to content

Commit

Permalink
General cleanup.
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
magnars committed Mar 21, 2013
1 parent bbf46f2 commit db4dd8a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
8 changes: 6 additions & 2 deletions lib/configuration.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
var _ = require("underscore");
var fs = require("fs");
var path = require("path");
var util = require("util");
var defaultConfig = require("./default-configuration");

// for node 0.6 backwards compatibility
if (!fs.existsSync) {
fs.existsSync = require("path").existsSync;
}

module.exports = {
exists: function () {
return path.existsSync("./autolint.js");
return fs.existsSync("./autolint.js");
},

defaultsPlus: function (config) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autolint",
"version": "1.0.4",
"version": "1.0.5",
"main": "./lib/autolint",
"description": "Autolint watches your files for jslint-errors.",
"author": "Magnar Sveen <magnars@gmail.com>",
Expand All @@ -13,7 +13,7 @@
"test": "buster test"
},
"engines": {
"node": ">=0.6"
"node": ">=0.8"
},
"bin": {
"autolint": "./bin/autolint"
Expand All @@ -23,7 +23,7 @@
"growl": "~1.1",
"underscore": "~1.1",
"when": "https://github.com/cujojs/when/tarball/1.0.2",
"fs-watch-tree": "~0.2"
"watch": "~0.6"
},
"keywords": [
"JavaScript",
Expand Down
5 changes: 2 additions & 3 deletions test/configuration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ var configuration = require("../lib/configuration");

buster.testCase('Configuration', {
"should check if autolint.js exists": function () {
var path = require("path");
this.stub(path, "existsSync").returns(true);
this.stub(fs, "existsSync").returns(true);

assert(configuration.exists());
assert.calledOnceWith(path.existsSync, "./autolint.js");
assert.calledOnceWith(fs.existsSync, "./autolint.js");
},

"should load config from autolint.js": function () {
Expand Down
16 changes: 0 additions & 16 deletions todo.md

This file was deleted.

12 changes: 12 additions & 0 deletions todo.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* Todo [0/8]
** TODO Dont bundle jslint or jshint, but fetch them with npm
- requires some loading magic for jslint, since Crockford refuses
to make jslint node-friendly.
** TODO look for changes in directories using some watch lib
** TODO create plugin for js2-mode.el that sets global-externs
** TODO use when.js instead of buster-promise
** TODO being blamed for introducing an error, AND praised for fixing it,
when changing around whitespace (changes line numbers)
** TODO keep getting "nice cleanup!" in a file with too many errors
** TODO files with more than 50 errors are reported as having 52 errors.
** TODO switching git branches can be spammy, any way around that?
File renamed without changes.

0 comments on commit db4dd8a

Please sign in to comment.