Skip to content

Commit

Permalink
Enable no-mixed-requires linting rule
Browse files Browse the repository at this point in the history
Don't allow non-require statements mixed in with module require
statements.  We can do this now that optional dependencies were removed
in request#1173.
  • Loading branch information
nylen committed Oct 16, 2014
1 parent 04548a9 commit 7eb7c37
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"no-unused-vars": [2, {"args":"none"}],
// Allow leading underscores for method names
// REASON: we use underscores to denote private methods
"no-underscore-dangle": 0,
// Allow non-require statements mixed in with module require statements
// REASON: we use the `optional()` helper, which makes this rule impossible to enforce
"no-mixed-requires": 0
"no-underscore-dangle": 0
}
}
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
var extend = require('util')._extend
, cookies = require('./lib/cookies')
, helpers = require('./lib/helpers')
, isFunction = helpers.isFunction

var isFunction = helpers.isFunction
, constructObject = helpers.constructObject
, filterForCallback = helpers.filterForCallback
, constructOptionsFrom = helpers.constructOptionsFrom
Expand Down
5 changes: 3 additions & 2 deletions lib/cookies.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict'

var tough = require('tough-cookie')
, Cookie = tough && tough.Cookie
, CookieJar = tough && tough.CookieJar

var Cookie = tough.Cookie
, CookieJar = tough.CookieJar


exports.parse = function(str) {
Expand Down
18 changes: 8 additions & 10 deletions request.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ var http = require('http')
, querystring = require('querystring')
, zlib = require('zlib')
, helpers = require('./lib/helpers')
, safeStringify = helpers.safeStringify
, md5 = helpers.md5
, isReadStream = helpers.isReadStream
, toBase64 = helpers.toBase64
, defer = helpers.defer
, bl = require('bl')
, oauth = require('oauth-sign')
, hawk = require('hawk')
Expand All @@ -24,20 +19,23 @@ var http = require('http')
, tunnel = require('tunnel-agent')
, stringstream = require('stringstream')
, caseless = require('caseless')

, ForeverAgent = require('forever-agent')
, FormData = require('form-data')

, cookies = require('./lib/cookies')
, globalCookieJar = cookies.jar()

, copy = require('./lib/copy')
, debug = require('./lib/debug')
, net = require('net')

var safeStringify = helpers.safeStringify
, md5 = helpers.md5
, isReadStream = helpers.isReadStream
, toBase64 = helpers.toBase64
, defer = helpers.defer
, globalCookieJar = cookies.jar()


var globalPool = {}
var isUrl = /^https?:|^unix:/
, isUrl = /^https?:|^unix:/

var defaultProxyHeaderWhiteList = [
'accept',
Expand Down

0 comments on commit 7eb7c37

Please sign in to comment.