Skip to content

Commit

Permalink
Configure the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Jun 25, 2015
1 parent 1a11c2a commit b392aed
Show file tree
Hide file tree
Showing 27 changed files with 98 additions and 177 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "tschaub"
}
13 changes: 0 additions & 13 deletions .jshintrc

This file was deleted.

3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
environment:
matrix:
- nodejs_version: "0.8"
- nodejs_version: "0.10"
- nodejs_version: "1.0"

Expand All @@ -13,7 +12,7 @@ test_script:
- set PATH=%APPDATA%\npm;%PATH%
- npm --version
- npm install
- node ./tasks.js test
- npm test

build: "off"

Expand Down
1 change: 0 additions & 1 deletion benchmarks/write-mock.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var fs = require('fs');
var path = require('path');

var mock = require('..');

Expand Down
2 changes: 0 additions & 2 deletions lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function notImplemented() {
}



/**
* Create a new stats object.
* @param {Object} config Stats properties.
Expand Down Expand Up @@ -126,7 +125,6 @@ Stats.prototype.isSocket = function() {
};



/**
* Create a new binding with the given file system.
* @param {FileSystem} system Mock file system.
Expand Down
1 change: 0 additions & 1 deletion lib/descriptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var constants = process.binding('constants');



/**
* Create a new file descriptor.
* @param {number} flags Flags.
Expand Down
2 changes: 0 additions & 2 deletions lib/directory.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict';

var path = require('path');
var util = require('util');

var Item = require('./item');

var constants = process.binding('constants');



/**
* A directory.
* @constructor
Expand Down
1 change: 0 additions & 1 deletion lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ var codes = {
};



/**
* Create an error.
* @param {string} code Error code.
Expand Down
2 changes: 0 additions & 2 deletions lib/file.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var path = require('path');
var util = require('util');

var Item = require('./item');
Expand All @@ -9,7 +8,6 @@ var EMPTY = new Buffer(0);
var constants = process.binding('constants');



/**
* A directory.
* @constructor
Expand Down
1 change: 0 additions & 1 deletion lib/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function getPathParts(filepath) {
}



/**
* Create a new file system.
* @constructor
Expand Down
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ exports.fs = function(config) {
var binding = new Binding(system);

// inject the mock binding
var mockFs = rewire(path.join(__dirname, '..', 'node', fsName));
mockFs.__set__('binding', binding);
var newMockFs = rewire(path.join(__dirname, '..', 'node', fsName));
newMockFs.__set__('binding', binding);

// overwrite fs.Stats from original binding
mockFs.Stats = binding.Stats;
newMockFs.Stats = binding.Stats;

return mockFs;
return newMockFs;
};


Expand Down
3 changes: 0 additions & 3 deletions lib/item.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

var path = require('path');

var counter = 0;


Expand Down Expand Up @@ -30,7 +28,6 @@ function getGid() {
}



/**
* A filesystem item.
* @constructor
Expand Down
2 changes: 0 additions & 2 deletions lib/symlink.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict';

var path = require('path');
var util = require('util');

var Item = require('./item');

var constants = process.binding('constants');



/**
* A directory.
* @constructor
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
},
"license": "MIT",
"scripts": {
"debug": "node --debug-brk ./tasks.js test",
"test": "node ./tasks.js lint test",
"pretest": "eslint benchmarks lib test",
"test": "mocha --recursive test",
"bench": "bench benchmarks"
},
"devDependencies": {
"chai": "~1.8.1",
"jshint": "~2.4.1",
"mocha": "~1.17.0",
"bench-it": "^0.3.0",
"chai": "^3.0.0",
"eslint": "^0.23.0",
"eslint-config-tschaub": "^1.0.0",
"glob": "~3.2.8",
"rimraf": "~2.2.6",
"bench-it": "~0.1.0"
"mocha": "^2.2.5",
"rimraf": "~2.2.6"
},
"dependencies": {
"rewire": "~2.0.0",
Expand Down
55 changes: 0 additions & 55 deletions tasks.js

This file was deleted.

21 changes: 0 additions & 21 deletions test/.jshintrc

This file was deleted.

4 changes: 3 additions & 1 deletion test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var chai = require('chai');


/** @type {boolean} */
chai.Assertion.includeStack = true;
chai.config.includeStack = true;


/**
Expand Down Expand Up @@ -60,5 +60,7 @@ exports.flags = function(str) {
case 'xa+':
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR |
constants.O_EXCL;
default:
throw new Error('Unsupported flag: ' + str);
}
};
3 changes: 3 additions & 0 deletions test/integration/filecount.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function numFiles(dir, items, callback) {
}
items.forEach(function(item) {
fs.stat(path.join(dir, item), function(err, stats) {
if (err) {
return callback(err);
}
if (stats && stats.isFile()) {
++files;
}
Expand Down
1 change: 1 addition & 0 deletions test/integration/filecount.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env mocha */
'use strict';

var mock = require('../../lib/index');
Expand Down
Loading

0 comments on commit b392aed

Please sign in to comment.