Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 982740a

Browse files
authored
fix: hash params without values (#441)
* fix: remove undefined value from hash params without value on reset * fix: eslintrc and prettier configuration * Fix errors of eslintrc file * Add necessary eslint plugins * Add prettier plugin * chore: review updates Replace negation with affirmation
1 parent 99b2edc commit 982740a

File tree

4 files changed

+298
-4
lines changed

4 files changed

+298
-4
lines changed

.eslintrc.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ module.exports = {
1414
},
1515
{
1616
files: ["*.ts", "*.tsx"],
17+
globals: {
18+
JSX: true,
19+
},
1720
parser: "@typescript-eslint/parser",
1821
plugins: ["@typescript-eslint"],
1922
parserOptions: {
2023
ecmaFeatures: { jsx: true },
2124
ecmaVersion: 2020,
2225
sourceType: "module",
2326
},
24-
rules: {},
27+
rules: {
28+
"no-unused-vars": "off",
29+
"@typescript-eslint/no-unused-vars": "error",
30+
},
2531
},
2632
],
2733
parser: "babel-eslint",
@@ -37,6 +43,5 @@ module.exports = {
3743
"react/prop-types": [0],
3844
"react-hooks/rules-of-hooks": "error",
3945
"react/display-name": 0,
40-
},
41-
types: ["node", "jest", "@testing-library/jest-dom"],
46+
}
4247
}

package-lock.json

Lines changed: 285 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,15 @@
100100
"canvas": "^2.6.0",
101101
"cpx": "^1.5.0",
102102
"eslint-config-airbnb": "^18.0.1",
103+
"eslint-config-prettier": "^6.3.0",
104+
"eslint-plugin-jest-dom": "^3.9.0",
105+
"eslint-plugin-prettier": "^3.1.0",
103106
"eslint-plugin-react-hooks": "^2.0.1",
104107
"eslint-plugin-testing-library": "^5.0.5",
105108
"install-peers-cli": "^2.2.0",
106109
"jest-environment-jsdom-fourteen": "^0.1.0",
107110
"node-sass": "^4.14.1",
111+
"prettier": "^1.19.1",
108112
"svg-sprite-loader": "^4.2.1",
109113
"svgo": "^1.3.2",
110114
"svgo-loader": "^2.2.1",

src/utils/hash-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const makeHashFromObject = (params: { [paramKey: string]: string }) => {
2828
return ""
2929
}
3030
return entries
31-
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
31+
.map(([key, value]) => (value === undefined ? key : `${key}=${encodeURIComponent(value)}`))
3232
.join(fragmentParamsSeparator)
3333
}
3434

0 commit comments

Comments
 (0)