Skip to content

Commit

Permalink
feat(eslint): enable eslint for the api
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Dec 17, 2021
1 parent c253548 commit 35d4a4a
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 91 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
@@ -0,0 +1,5 @@
/branding/
/stats/
/storybook-static/
node_modules/
/packages/recompose/
2 changes: 0 additions & 2 deletions .eslintrc.yml
Expand Up @@ -4,8 +4,6 @@ extends:
- plugin:@typescript-eslint/recommended
- plugin:prettier/recommended
- prettier
- prettier/@typescript-eslint
- prettier/react

rules:
# Leave this as a warning while we convert the codebase, then remove it
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -266,5 +266,8 @@ api: ##@5 API run API in regular mode (no watcher)
@echo "${YELLOW}Starting API${RESET}"
@cd api && yarn start

api-lint:
@./node_modules/.bin/eslint ./api/src

api-deploy: ##@5 Deploy API on heroku
git subtree push --prefix api heroku master
4 changes: 2 additions & 2 deletions api/src/mapping/common.ts
Expand Up @@ -11,7 +11,7 @@ export const custom = Joi.extend(

try {
return { value: JSON.parse(value) }
} catch (ignoreErr) {}
} catch (ignoreErr) {} // eslint-disable-line no-empty
},
},
},
Expand All @@ -25,7 +25,7 @@ export const custom = Joi.extend(

try {
return { value: JSON.parse(value) }
} catch (ignoreErr) {}
} catch (ignoreErr) {} // eslint-disable-line no-empty
},
},
}
Expand Down
37 changes: 0 additions & 37 deletions api/src/samples/heatmap.js

This file was deleted.

29 changes: 15 additions & 14 deletions package.json
Expand Up @@ -17,11 +17,11 @@
},
"keywords": [],
"devDependencies": {
"@babel/core": "^7.10.3",
"@babel/core": "^7.16.5",
"@ekino/config": "^0.3.0",
"@nivo/generators": "*",
"@rollup/plugin-babel": "^5.0.3",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.1.1",
"@storybook/addon-actions": "^6.0.26",
"@storybook/addon-info": "^5.3.21",
"@storybook/addon-knobs": "^6.0.26",
Expand All @@ -30,22 +30,22 @@
"@storybook/addons": "^6.0.26",
"@storybook/react": "^6.0.26",
"@storybook/theming": "^6.0.26",
"@types/enzyme": "^3.10.8",
"@types/enzyme": "^3.10.10",
"@types/jest": "^26.0.15",
"@types/lodash": "^4.14.170",
"@types/react": "^17.0.11",
"@types/react-dom": "^17.0.8",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"@wojtekmaj/enzyme-adapter-react-17": "0.6.2",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
"@wyze/clog-cli": "^1.0.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.1.0",
"babel-loader": "^8.2.3",
"babel-plugin-lodash": "^3.3.4",
"babel-preset-react-app": "^10.0.0",
"babel-preset-react-app": "^10.0.1",
"chalk": "^2.4.2",
"core-js": "^3.0.1",
"core-js": "^3.19.3",
"enzyme": "^3.11.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -61,7 +61,7 @@
"jsdom": "^16.2.2",
"lerna": "^3.22.1",
"lodash": "^4.17.21",
"prettier": "^2.0.5",
"prettier": "^2.5.1",
"prop-types": "^15.7.2",
"puppeteer": "^0.13.0",
"raf": "^3.4.1",
Expand Down Expand Up @@ -95,7 +95,8 @@
"website"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1"
"npm-normalize-package-bin": "^1.0.1",
"rollup-plugin-terser": "^7.0.2"
},
"engines": {
"node": "16.x"
Expand Down
74 changes: 38 additions & 36 deletions yarn.lock
Expand Up @@ -79,7 +79,7 @@
semver "^5.4.1"
source-map "^0.5.0"

"@babel/core@^7.1.0", "@babel/core@^7.10.3", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.16.0", "@babel/core@^7.7.5":
"@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.16.0", "@babel/core@^7.16.5", "@babel/core@^7.7.5":
version "7.16.5"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.5.tgz#924aa9e1ae56e1e55f7184c8bf073a50d8677f5c"
integrity sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==
Expand Down Expand Up @@ -3312,26 +3312,25 @@
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@rollup/plugin-babel@^5.0.3":
"@rollup/plugin-babel@^5.3.0":
version "5.3.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"
integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==
dependencies:
"@babel/helper-module-imports" "^7.10.4"
"@rollup/pluginutils" "^3.1.0"

"@rollup/plugin-node-resolve@^8.0.1":
version "8.4.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz#261d79a680e9dc3d86761c14462f24126ba83575"
integrity sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ==
"@rollup/plugin-node-resolve@^13.1.1":
version "13.1.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz#d38ba06e7b181ab4df64c75409b43d9bdc95ae34"
integrity sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
builtin-modules "^3.1.0"
deep-freeze "^0.0.1"
deepmerge "^4.2.2"
is-module "^1.0.0"
resolve "^1.17.0"
resolve "^1.19.0"

"@rollup/pluginutils@^3.1.0":
version "3.1.0"
Expand Down Expand Up @@ -4519,7 +4518,7 @@
dependencies:
"@types/ms" "*"

"@types/enzyme@^3.10.8":
"@types/enzyme@^3.10.10":
version "3.10.10"
resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.10.tgz#3a44cc66571432ab9e1773a831af3742beb39275"
integrity sha512-/D4wFhiEjUDfPu+j5FVK0g/jf7rqeEIpNfAI+kyxzLpw5CKO0drnW3W5NC38alIjsWgnyQ8pbuPF5+UD+vhVyg==
Expand Down Expand Up @@ -4838,7 +4837,7 @@
dependencies:
"@types/react" "*"

"@types/react-dom@^17.0.8":
"@types/react-dom@^17.0.11":
version "17.0.11"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.11.tgz#e1eadc3c5e86bdb5f7684e00274ae228e7bcc466"
integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q==
Expand Down Expand Up @@ -4887,7 +4886,7 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@17.0.11", "@types/react@^17.0.11":
"@types/react@*", "@types/react@17.0.11", "@types/react@^17.0.11", "@types/react@^17.0.37":
version "17.0.37"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959"
integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg==
Expand Down Expand Up @@ -5039,7 +5038,7 @@
resolved "https://registry.yarnpkg.com/@types/yoga-layout/-/yoga-layout-1.9.2.tgz#efaf9e991a7390dc081a0b679185979a83a9639a"
integrity sha512-S9q47ByT2pPvD65IvrWp7qppVMpk9WGMbVq9wbWZOHg6tnXSD4vyhao6nOSBwwfDdV2p3Kx9evA9vI+XWTfDvw==

"@typescript-eslint/eslint-plugin@^4.33.0", "@typescript-eslint/eslint-plugin@^4.6.1":
"@typescript-eslint/eslint-plugin@^4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276"
integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==
Expand All @@ -5053,7 +5052,7 @@
semver "^7.3.5"
tsutils "^3.21.0"

"@typescript-eslint/eslint-plugin@^5.5.0":
"@typescript-eslint/eslint-plugin@^5.5.0", "@typescript-eslint/eslint-plugin@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz#12d54709f8ea1da99a01d8a992cd0474ad0f0aa9"
integrity sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==
Expand Down Expand Up @@ -5091,7 +5090,7 @@
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"

"@typescript-eslint/parser@^4.33.0", "@typescript-eslint/parser@^4.6.1":
"@typescript-eslint/parser@^4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899"
integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==
Expand All @@ -5101,7 +5100,7 @@
"@typescript-eslint/typescript-estree" "4.33.0"
debug "^4.3.1"

"@typescript-eslint/parser@^5.5.0":
"@typescript-eslint/parser@^5.5.0", "@typescript-eslint/parser@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.7.0.tgz#4dca6de463d86f02d252e681136a67888ea3b181"
integrity sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g==
Expand Down Expand Up @@ -5450,21 +5449,19 @@
"@webassemblyjs/wast-parser" "1.9.0"
"@xtuc/long" "4.2.2"

"@wojtekmaj/enzyme-adapter-react-17@0.6.2":
version "0.6.2"
resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.6.2.tgz#7f05a91e6b374ba94ab10467802346198403d3e1"
integrity sha512-9STl8ZKp8VPJgtr6jEAv9IThX0PAJ1JXKv6IlXzq22Ejyk1bhSxJ6RfJCJT9A9+8JlDIf3BX5CC4s0Bs4/1wFQ==
"@wojtekmaj/enzyme-adapter-react-17@0.6.6":
version "0.6.6"
resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.6.6.tgz#2ee3d4956caea4de05e372e5d9f39b31becffe6a"
integrity sha512-gSfhg8CiL0Vwc2UgUblGVZIy7M0KyXaZsd8+QwzV8TSVRLkGyzdLtYEcs9wRWyQTsdmOd+oRGqbVgUX7AVJxug==
dependencies:
"@wojtekmaj/enzyme-adapter-utils" "^0.1.1"
"@wojtekmaj/enzyme-adapter-utils" "^0.1.2"
enzyme-shallow-equal "^1.0.0"
has "^1.0.0"
object.assign "^4.1.0"
object.values "^1.1.0"
prop-types "^15.7.0"
react-is "^17.0.2"
react-is "^17.0.0"
react-test-renderer "^17.0.0"

"@wojtekmaj/enzyme-adapter-utils@^0.1.1":
"@wojtekmaj/enzyme-adapter-utils@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-utils/-/enzyme-adapter-utils-0.1.2.tgz#82b81801e234b8f1febde91b243aaa8c5ba4aaa9"
integrity sha512-MM/DqDqvxNVlWLqSVQiUbRN9MuDLJfefmPbJ8ZKdmdf5ID8G+i42XhFpoQh5bAZUCdwzRae3+WSZl2lXcFOrhw==
Expand Down Expand Up @@ -6211,7 +6208,7 @@ babel-jest@^26.6.3:
graceful-fs "^4.2.4"
slash "^3.0.0"

babel-loader@^8.0.0, babel-loader@^8.1.0, babel-loader@^8.2.3:
babel-loader@^8.0.0, babel-loader@^8.2.3:
version "8.2.3"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.3.tgz#8986b40f1a64cacfcb4b8429320085ef68b1342d"
integrity sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==
Expand Down Expand Up @@ -6488,7 +6485,7 @@ babel-preset-jest@^26.6.2:
babel-plugin-jest-hoist "^26.6.2"
babel-preset-current-node-syntax "^1.0.0"

babel-preset-react-app@^10.0.0, babel-preset-react-app@^10.0.1:
babel-preset-react-app@^10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-10.0.1.tgz#ed6005a20a24f2c88521809fa9aea99903751584"
integrity sha512-b0D9IZ1WhhCWkrTXyFuIIgqGzSkRIH5D5AmB0bXbzYAB1OBAwHcUeyWW2LorutLWF5btNo/N7r/cIdmvvKJlYg==
Expand Down Expand Up @@ -8053,7 +8050,7 @@ core-js@^2.4.0:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==

core-js@^3.0.1, core-js@^3.0.4, core-js@^3.17.2, core-js@^3.6.5, core-js@^3.8.2:
core-js@^3.0.1, core-js@^3.0.4, core-js@^3.17.2, core-js@^3.19.3, core-js@^3.6.5, core-js@^3.8.2:
version "3.19.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.3.tgz#6df8142a996337503019ff3235a7022d7cdf4559"
integrity sha512-LeLBMgEGSsG7giquSzvgBrTS7V5UL6ks3eQlUSbN8dJStlLFiRzUm5iqsRyzUB8carhfKjkJ2vzKqE6z1Vga9g==
Expand Down Expand Up @@ -8807,11 +8804,6 @@ deep-extend@^0.6.0:
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==

deep-freeze@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84"
integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=

deep-is@^0.1.3, deep-is@~0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
Expand Down Expand Up @@ -13939,7 +13931,7 @@ jest-worker@^24.9.0:
merge-stream "^2.0.0"
supports-color "^6.1.0"

jest-worker@^26.3.0, jest-worker@^26.5.0, jest-worker@^26.6.2:
jest-worker@^26.2.1, jest-worker@^26.3.0, jest-worker@^26.5.0, jest-worker@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed"
integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==
Expand Down Expand Up @@ -17426,7 +17418,7 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.0.5, prettier@^2.2.1, prettier@^2.5.1:
prettier@^2.2.1, prettier@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==
Expand Down Expand Up @@ -18882,7 +18874,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=

resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2:
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
Expand Down Expand Up @@ -19007,6 +18999,16 @@ rollup-plugin-strip-banner@^2.0.0:
magic-string "0.25.7"
rollup-pluginutils "2.8.2"

rollup-plugin-terser@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d"
integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==
dependencies:
"@babel/code-frame" "^7.10.4"
jest-worker "^26.2.1"
serialize-javascript "^4.0.0"
terser "^5.0.0"

rollup-plugin-visualizer@^5.5.2:
version "5.5.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.5.2.tgz#ae2130ee5ae4a2d901e764e492b71357cb95eed7"
Expand Down Expand Up @@ -20573,7 +20575,7 @@ terser@^4.1.2, terser@^4.6.3:
source-map "~0.6.1"
source-map-support "~0.5.12"

terser@^5.3.4, terser@^5.7.2:
terser@^5.0.0, terser@^5.3.4, terser@^5.7.2:
version "5.10.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc"
integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==
Expand Down

0 comments on commit 35d4a4a

Please sign in to comment.