Skip to content

Commit 048cf18

Browse files
committed
chore: bump deps, fixed linting
1 parent 6ac6429 commit 048cf18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4640
-4347
lines changed

examples/simple-get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const request = require('..');
77
const url =
88
'https://gist.githubusercontent.com/reinaldo13/cdbb4d663ba23410a77b/raw/0345267767d50790051951ddc460e2699649de2b/it-works.txt';
99

10-
request.get(url, (err, res) => {
11-
if (err) throw err;
10+
request.get(url, (error, res) => {
11+
if (error) throw error;
1212
console.log(res.text);
1313
});

package.json

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,54 @@
2424
],
2525
"dependencies": {
2626
"component-emitter": "^1.3.0",
27-
"cookiejar": "^2.1.2",
28-
"debug": "^4.3.1",
29-
"fast-safe-stringify": "^2.0.7",
27+
"cookiejar": "^2.1.3",
28+
"debug": "^4.3.3",
29+
"fast-safe-stringify": "^2.1.1",
3030
"form-data": "^4.0.0",
3131
"formidable": "^2.0.1",
3232
"methods": "^1.1.2",
3333
"mime": "^2.5.0",
34-
"qs": "^6.9.6",
34+
"qs": "^6.10.1",
3535
"readable-stream": "^3.6.0",
36-
"semver": "^7.3.4"
36+
"semver": "^7.3.5"
3737
},
3838
"devDependencies": {
39-
"@babel/cli": "^7.12.16",
40-
"@babel/core": "^7.12.16",
41-
"@babel/plugin-transform-runtime": "^7.12.15",
42-
"@babel/preset-env": "^7.12.16",
43-
"@commitlint/cli": "^11.0.0",
44-
"@commitlint/config-conventional": "^11.0.0",
39+
"@babel/cli": "^7.16.0",
40+
"@babel/core": "^7.16.0",
41+
"@babel/plugin-transform-runtime": "^7.16.4",
42+
"@babel/preset-env": "^7.16.4",
43+
"@commitlint/cli": "^15.0.0",
44+
"@commitlint/config-conventional": "^15.0.0",
4545
"Base64": "^1.1.0",
4646
"babelify": "^10.0.0",
4747
"basic-auth-connect": "^1.0.0",
4848
"body-parser": "^1.19.0",
4949
"browserify": "^17.0.0",
50-
"codecov": "^3.8.1",
51-
"cookie-parser": "^1.4.5",
50+
"codecov": "^3.8.3",
51+
"cookie-parser": "^1.4.6",
5252
"cross-env": "^7.0.3",
53-
"eslint": "^7.20.0",
54-
"eslint-config-xo-lass": "^1.0.5",
55-
"eslint-plugin-compat": "^3.9.0",
53+
"eslint": "^8.3.0",
54+
"eslint-config-xo-lass": "^1.0.6",
55+
"eslint-plugin-compat": "^4.0.0",
5656
"eslint-plugin-node": "^11.1.0",
5757
"express": "^4.17.1",
58-
"express-session": "^1.17.1",
58+
"express-session": "^1.17.2",
5959
"fixpack": "^4.0.0",
60-
"husky": "^5.0.9",
61-
"lint-staged": "^10.5.4",
60+
"husky": "^7.0.4",
61+
"lint-staged": "^12.1.2",
6262
"marked": "^2.0.0",
6363
"mocha": "3.5.3",
64-
"multer": "^1.4.2",
64+
"multer": "^1.4.3",
6565
"nyc": "^15.1.0",
66-
"remark-cli": "^9.0.0",
66+
"remark-cli": "^10.0.1",
6767
"remark-preset-github": "^4.0.1",
6868
"rimraf": "^3.0.2",
6969
"should": "^13.2.3",
7070
"should-http": "^0.1.1",
7171
"tinyify": "^3.0.0",
72-
"xo": "0.37.1",
72+
"xo": "^0.47.0",
7373
"zuul": "^3.12.0"
7474
},
75-
"engines": {
76-
"node": ">= 7.0.0"
77-
},
7875
"homepage": "https://github.com/visionmedia/superagent",
7976
"husky": {
8077
"hooks": {
@@ -178,51 +175,56 @@
178175
"mocha"
179176
],
180177
"rules": {
181-
"block-scoped-var": "off",
182-
"complexity": "off",
183-
"default-case": "off",
184-
"eqeqeq": "off",
185-
"func-name-matching": "off",
186-
"func-names": "off",
187-
"guard-for-in": "off",
188-
"handle-callback-err": "off",
189-
"import/no-extraneous-dependencies": "off",
190-
"import/no-unassigned-import": "off",
191-
"import/order": "off",
192-
"max-nested-callbacks": "off",
193-
"new-cap": "off",
194-
"no-eq-null": "off",
195-
"no-extend-native": "off",
196-
"no-implicit-coercion": "off",
197-
"no-multi-assign": "off",
198-
"no-negated-condition": "off",
199-
"no-prototype-builtins": "off",
200-
"no-redeclare": "off",
201-
"no-undef": "off",
202-
"no-unused-expressions": "off",
203-
"no-unused-vars": "off",
204-
"no-use-extend-native/no-use-extend-native": "off",
205-
"no-useless-escape": "off",
206-
"no-var": "off",
207-
"no-void": "off",
208-
"node/no-deprecated-api": "off",
209-
"prefer-rest-params": "off",
210-
"prefer-spread": "off",
211-
"promise/prefer-await-to-then": "off",
212-
"promise/valid-params": "off",
213-
"unicorn/filename-case": "off",
214-
"valid-jsdoc": "off",
215-
"node/no-unsupported-features/node-builtins": "off",
216-
"node/no-path-concat": "off"
178+
"block-scoped-var": "warn",
179+
"complexity": "warn",
180+
"default-case": "warn",
181+
"eqeqeq": "warn",
182+
"func-name-matching": "warn",
183+
"func-names": "warn",
184+
"guard-for-in": "warn",
185+
"handle-callback-err": "warn",
186+
"import/no-extraneous-dependencies": "warn",
187+
"import/no-unassigned-import": "warn",
188+
"import/order": "warn",
189+
"max-nested-callbacks": "warn",
190+
"new-cap": "warn",
191+
"no-eq-null": "warn",
192+
"no-extend-native": "warn",
193+
"no-implicit-coercion": "warn",
194+
"no-multi-assign": "warn",
195+
"no-negated-condition": "warn",
196+
"no-prototype-builtins": "warn",
197+
"no-redeclare": "warn",
198+
"no-undef": "warn",
199+
"no-unused-expressions": "warn",
200+
"no-unused-vars": "warn",
201+
"no-use-extend-native/no-use-extend-native": "warn",
202+
"no-useless-escape": "warn",
203+
"no-var": "warn",
204+
"no-void": "warn",
205+
"node/no-deprecated-api": "warn",
206+
"prefer-rest-params": "warn",
207+
"prefer-spread": "warn",
208+
"unicorn/filename-case": "warn",
209+
"valid-jsdoc": "warn",
210+
"node/no-path-concat": "warn",
211+
"unicorn/no-empty-file": "warn"
217212
}
218213
}
219214
],
220215
"rules": {
221-
"unicorn/prevent-abbreviations": "off",
222-
"node/no-unsupported-features/es-syntax": "off"
216+
"unicorn/prevent-abbreviations": "warn",
217+
"no-bitwise": "warn",
218+
"node/prefer-global/buffer": "warn",
219+
"node/prefer-global/process": "warn",
220+
"unicorn/no-new-array": "warn",
221+
"unicorn/no-this-assignment": "warn",
222+
"unicorn/prefer-spread": "warn",
223+
"unicorn/catch-error-name": "warn",
224+
"unicorn/prefer-code-point": "warn"
223225
},
224226
"globals": [
225227
"ActiveXObject"
226228
]
227229
}
228-
}
230+
}

src/agent-base.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function Agent() {
22
this._defaults = [];
33
}
44

5-
[
5+
for (const fn of [
66
'use',
77
'on',
88
'once',
@@ -25,18 +25,18 @@ function Agent() {
2525
'pfx',
2626
'cert',
2727
'disableTLSCerts'
28-
].forEach((fn) => {
28+
]) {
2929
// Default setting for all requests from this agent
3030
Agent.prototype[fn] = function (...args) {
3131
this._defaults.push({ fn, args });
3232
return this;
3333
};
34-
});
34+
}
3535

36-
Agent.prototype._setDefaults = function (req) {
37-
this._defaults.forEach((def) => {
38-
req[def.fn](...def.args);
39-
});
36+
Agent.prototype._setDefaults = function (request) {
37+
for (const def of this._defaults) {
38+
request[def.fn](...def.args);
39+
}
4040
};
4141

4242
module.exports = Agent;

0 commit comments

Comments
 (0)