Skip to content

Commit

Permalink
[Dev Deps] backport from main
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 10, 2022
1 parent fd950b0 commit f814a7f
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 45 deletions.
15 changes: 14 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 140
max_line_length = 160
quote_type = single

[test/*]
max_line_length = off

[LICENSE.md]
indent_size = off

[*.md]
max_line_length = off

Expand All @@ -28,3 +32,12 @@ indent_size = 2
[LICENSE]
indent_size = 2
max_line_length = off

[coverage/**/*]
indent_size = off
indent_style = off
indent = off
max_line_length = off

[.nycrc]
indent_style = tab
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

24 changes: 21 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,35 @@

"extends": "@ljharb",

"ignorePatterns": [
"dist/",
],

"rules": {
"complexity": 0,
"consistent-return": 1,
"func-name-matching": 0,
"func-name-matching": 0,
"id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
"indent": [2, 4],
"max-lines-per-function": 0,
"max-params": [2, 12],
"max-statements": [2, 45],
"multiline-comment-style": 0,
"no-continue": 1,
"no-magic-numbers": 0,
"no-param-reassign": 1,
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
"operator-linebreak": [2, "before"],
}
},

"overrides": [
{
"files": "test/**",
"rules": {
"max-lines-per-function": 0,
"max-statements": 0,
"no-extend-native": 0,
"function-paren-newline": 0,
},
},
],
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ dist/*
yarn.lock
package-lock.json
npm-shrinkwrap.json

.nyc_output/
coverage/
18 changes: 14 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
bower.json
component.json
.npmignore
.travis.yml
# gitignore
npm-debug.log
node_modules
.DS_Store

# Only apps should have lockfiles
yarn.lock
package-lock.json
npm-shrinkwrap.json

.nyc_output/
coverage/

.github/workflows
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"dist"
]
}
10 changes: 5 additions & 5 deletions lib/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ var utils = require('./utils');
var formats = require('./formats');

var arrayPrefixGenerators = {
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
brackets: function brackets(prefix) {
return prefix + '[]';
},
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
indices: function indices(prefix, key) {
return prefix + '[' + key + ']';
},
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
repeat: function repeat(prefix) {
return prefix;
}
};
Expand All @@ -28,14 +28,14 @@ var defaults = {
encode: true,
encoder: utils.encode,
encodeValuesOnly: false,
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
serializeDate: function serializeDate(date) {
return toISO.call(date);
},
skipNulls: false,
strictNullHandling: false
};

var stringify = function stringify( // eslint-disable-line func-name-matching
var stringify = function stringify(
object,
prefix,
generateArrayPrefix,
Expand Down
1 change: 1 addition & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ var encode = function encode(str) {

i += 1;
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
/* eslint operator-linebreak: [2, "before"] */
out += hexTable[0xF0 | (c >> 18)]
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
Expand Down
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,32 @@
"engines": {
"node": ">=0.6"
},
"dependencies": {},
"devDependencies": {
"@ljharb/eslint-config": "^12.2.1",
"browserify": "^16.2.0",
"covert": "^1.1.0",
"editorconfig-tools": "^0.1.1",
"eslint": "^4.19.1",
"@ljharb/eslint-config": "^20.1.0",
"aud": "^1.1.5",
"browserify": "^16.5.2",
"eclint": "^2.8.1",
"eslint": "^8.6.0",
"evalmd": "^0.0.17",
"iconv-lite": "^0.4.21",
"iconv-lite": "^0.4.24",
"in-publish": "^2.0.1",
"mkdirp": "^0.5.1",
"nyc": "^10.3.2",
"qs-iconv": "^1.0.4",
"safe-publish-latest": "^1.1.1",
"safe-publish-latest": "^2.0.0",
"safer-buffer": "^2.1.2",
"tape": "^4.9.0"
"tape": "^5.4.0"
},
"scripts": {
"prepublish": "safe-publish-latest && npm run dist",
"prepublishOnly": "safe-publish-latest && npm run dist",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run --silent readme && npm run --silent lint",
"test": "npm run --silent coverage",
"tests-only": "node test",
"test": "npm run --silent tests-only",
"tests-only": "nyc tape 'test/**/*.js'",
"posttest": "aud --production",
"readme": "evalmd README.md",
"postlint": "editorconfig-tools check * lib/* test/*",
"lint": "eslint lib/*.js test/*.js",
"coverage": "covert test",
"postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs .",
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
},
"license": "BSD-3-Clause"
Expand Down
15 changes: 0 additions & 15 deletions test/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ test('parse()', function (t) {

st.deepEqual(
qs.parse('a[b]=c&a=toString', { plainObjects: true }),
{ a: { b: 'c', toString: true } },
{ __proto__: null, a: { __proto__: null, b: 'c', toString: true } },
'can overwrite prototype with plainObjects true'
);

Expand Down

0 comments on commit f814a7f

Please sign in to comment.