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

Commit

Permalink
fix: hash params without values (#441)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
burbuli8ra authored Sep 1, 2022
1 parent 99b2edc commit 982740a
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ module.exports = {
},
{
files: ["*.ts", "*.tsx"],
globals: {
JSX: true,
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2020,
sourceType: "module",
},
rules: {},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
},
},
],
parser: "babel-eslint",
Expand All @@ -37,6 +43,5 @@ module.exports = {
"react/prop-types": [0],
"react-hooks/rules-of-hooks": "error",
"react/display-name": 0,
},
types: ["node", "jest", "@testing-library/jest-dom"],
}
}
285 changes: 285 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@
"canvas": "^2.6.0",
"cpx": "^1.5.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-jest-dom": "^3.9.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react-hooks": "^2.0.1",
"eslint-plugin-testing-library": "^5.0.5",
"install-peers-cli": "^2.2.0",
"jest-environment-jsdom-fourteen": "^0.1.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"svg-sprite-loader": "^4.2.1",
"svgo": "^1.3.2",
"svgo-loader": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/hash-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const makeHashFromObject = (params: { [paramKey: string]: string }) => {
return ""
}
return entries
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
.map(([key, value]) => (value === undefined ? key : `${key}=${encodeURIComponent(value)}`))
.join(fragmentParamsSeparator)
}

Expand Down

0 comments on commit 982740a

Please sign in to comment.