Skip to content

Commit

Permalink
Replace jshint with eslint.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jan 11, 2017
1 parent d0648c8 commit 3339d57
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/coverage/
/.nyc_coverage/
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: 'onelint'
};
4 changes: 2 additions & 2 deletions lib/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ module.exports = function (options) {
}

var contentType = res.getHeader('Content-Type');

var filterInfosAndTargetFormat;
if (res.statusCode === 304) {
res.unhijack();
} else if (isMetadataRequest || (contentType && (options.allowedImageSourceContentTypes ? options.allowedImageSourceContentTypes.indexOf(contentType) !== -1 : contentType.indexOf('image/') === 0))) {
Expand All @@ -197,7 +197,7 @@ module.exports = function (options) {
etag: oldETag
};

var filterInfosAndTargetFormat = makeFilterInfosAndTargetFormat();
filterInfosAndTargetFormat = makeFilterInfosAndTargetFormat();

if (filterInfosAndTargetFormat.filterInfos.length === 0) {
return res.unhijack(true);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
"devDependencies": {
"compression": "1.6.1",
"coveralls": "2.11.4",
"eslint": "3.13.1",
"eslint-config-onelint": "1.1.0",
"express": "4.13.4",
"gifsicle-stream": "0.3.1",
"istanbul": "0.4.0",
"jshint": "2.9.1-rc1",
"magicpen": "5.5.0",
"magicpen-prism": "2.2.1",
"mocha": "2.4.5",
Expand All @@ -47,7 +48,7 @@
"unexpected-sinon": "^10.5.0"
},
"scripts": {
"lint": "jshint .",
"lint": "eslint .",
"test": "mocha && npm run lint",
"travis": "npm test && npm run coverage && (<coverage/lcov.info coveralls || true)",
"coverage": "NODE_ENV=development istanbul cover _mocha -- --reporter dot && echo google-chrome coverage/lcov-report/index.html"
Expand Down
8 changes: 4 additions & 4 deletions test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('express-processimage', function () {
return expect(
express()
.use(processImage(config))
.use(express['static'](root)),
.use(express.static(root)),
'to yield exchange', {
request: subject,
response: value
Expand Down Expand Up @@ -664,7 +664,7 @@ describe('express-processimage', function () {
express()
.use(require('compression')())
.use(processImage())
.use(express['static'](root)),
.use(express.static(root)),
'to yield exchange', {
request: 'GET /the-villa-facade.png?sourceContentType=image%2Fpng&ignoreAspectRatio&resize=652,435&extract=315,10,280,420',
response: {
Expand Down Expand Up @@ -902,7 +902,7 @@ describe('express-processimage', function () {
};
var server = express()
.use(processImage(config))
.use(express['static'](root))
.use(express.static(root))
.listen(0);

var serverAddress = server.address();
Expand Down Expand Up @@ -980,7 +980,7 @@ describe('express-processimage', function () {
it('should send an error response when an out-of-bounds extract operation is requested', function () {
var server = express()
.use(processImage(config))
.use(express['static'](root))
.use(express.static(root))
.listen(0);

var serverAddress = server.address();
Expand Down
1 change: 1 addition & 0 deletions testdata/addBogusElement.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global svgFilter*/
var g = document.createElement('g');
g.setAttribute('id', svgFilter.bogusElementId || 'blablaf');
document.documentElement.appendChild(g);

0 comments on commit 3339d57

Please sign in to comment.