Skip to content

Commit

Permalink
Use eslint instead of jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
blond committed Mar 17, 2016
1 parent d5277a8 commit 33c636d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples/**
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
env:
node: true
browser: true

extends: pedant
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ module.exports = function (helper) {

return vfs.makeDir(dirname)
.then(function () {
var bemjsonAssetFilename = path.join(__dirname, 'assets', 'bemjson.jst');

return vow.all([
vfs.exists(bemjsonFilename).then(function (isExists) {
if (!isExists) {
var bemjsonAssetFilename = path.join(__dirname, 'assets', 'bemjson.js');

return vfs.read(bemjsonAssetFilename)
.then(function (bemjsonAsset) {
var compiled = _.template(bemjsonAsset);
Expand Down
22 changes: 11 additions & 11 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ var fs = require('fs'),
Logger = require('enb/lib/logger'),
logger = new Logger(),
oldTargets = [],
NEED_COVERAGE = process.env.ISTANBUL_COVERAGE,
covCollector,
covIdx;
NEED_COVERAGE = process.env.ISTANBUL_COVERAGE;

if (NEED_COVERAGE) {
var istanbul = require('istanbul'),
covCollector = new (istanbul.Collector)(),
instrumenter = new (istanbul.Instrumenter)(),
covIdx = 0;
var istanbul = require('istanbul'),
instrumenter = new (istanbul.Instrumenter)(),
covCollector = new (istanbul.Collector)(),
covIdx = 0;
}

exports.run = function (targets, root, sources) {
Expand Down Expand Up @@ -95,7 +93,9 @@ exports.run = function (targets, root, sources) {
function dropCovBuffer() {
try {
fs.unlinkSync(covBufFile);
} catch (e) {}
} catch (e) {
/* ignore error */
}
}

function runMochaPhantom() {
Expand Down Expand Up @@ -143,14 +143,14 @@ exports.run = function (targets, root, sources) {
matcher.files.forEach(function (file) {
// As implemented here:
// https://github.com/gotwarlost/istanbul/blob/master/lib/command/common/run-with-cover.js#L222
var key = path.relative(root, file);
transformer(fs.readFileSync(file, 'utf-8'), key);
var filename = path.relative(root, file);
transformer(fs.readFileSync(file, 'utf-8'), filename);

Object.keys(instrumenter.coverState.s).forEach(function (key) {
instrumenter.coverState.s[key] = 0;
});

data[key] = instrumenter.coverState;
data[filename] = instrumenter.coverState;
});

covCollector.add(data);
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
"ym": "0.1.2"
},
"devDependencies": {
"bower": "1.5.2",
"enb": ">= 0.13.0 < 2.0.0",
"enb-bh": "1.2.0",
"enb-magic-factory": ">= 0.3.0 < 1.0.0",
"bower": "1.5.2",
"jscs": "1.13.1",
"jshint": "2.8.0",
"enb-bh": "1.2.0"
"eslint": "2.4.0",
"eslint-config-pedant": "0.1.1",
"jscs": "1.13.1"
},
"main": "lib/index.js",
"scripts": {
"test": "npm run lint && npm run test-silly",
"lint": "jshint . && jscs .",
"lint": "eslint . && jscs .",
"test-silly": "npm run clean && npm run fixtures && npm run build-examples && npm run clean && npm run build-examples-coverage",
"fixtures": "cd examples && bower i",
"build-examples": "enb -d examples/silly make __magic__ set.specs && enb -d examples/silly make specs-bh",
Expand Down

0 comments on commit 33c636d

Please sign in to comment.