diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d9b169d07..a74021396 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -74,16 +74,35 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'warn', '@typescript-eslint/no-unsafe-argument': 'warn', '@typescript-eslint/no-unsafe-member-access': 'warn', - '@typescript-eslint/restrict-template-expressions': 'warn', '@typescript-eslint/no-unsafe-return': 'warn', '@typescript-eslint/no-unsafe-assignment': 'warn', - '@typescript-eslint/no-empty-function': 'warn', - '@typescript-eslint/restrict-plus-operands': 'warn', - '@typescript-eslint/no-floating-promises': 'warn', + '@typescript-eslint/member-delimiter-style': [ 'error', { multiline: { delimiter: 'none' } }, ], + + 'prefer-const': 'error', + curly: 'error', + 'padding-line-between-statements': [ + 'error', + // Require padding line before return statement + { blankLine: 'always', prev: '*', next: 'return' }, + //Require padding line after import + { blankLine: 'always', prev: ['import', 'cjs-import'], next: '*' }, + { + blankLine: 'any', + prev: ['import', 'cjs-import'], + next: ['import', 'cjs-import'], + }, + //Require padding line before export + { blankLine: 'always', prev: '*', next: ['export', 'cjs-export'] }, + { + blankLine: 'any', + prev: ['export', 'cjs-export'], + next: ['export', 'cjs-export'], + }, + ], }, }, { diff --git a/package.json b/package.json index 766965443..ade7c2526 100644 --- a/package.json +++ b/package.json @@ -31,13 +31,19 @@ "i18n:translate": "yarn workspace site i18n:translate" }, "resolutions": { - "prettier": "^2.5.1", "@mui/styled-engine": "npm:@mui/styled-engine-sc@latest" }, "packageManager": "yarn@3.2.0", "devDependencies": { - "eslint": "^8.10.0", - "prettier": "^2.5.1", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", + "eslint": "^8.12.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-cypress": "^2.12.1", + "eslint-plugin-mocha": "^10.0.3", + "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react-hooks": "^4.3.0", + "prettier": "^2.6.1", "rimraf": "^3.0.2" } } diff --git a/site/package.json b/site/package.json index 9ff268893..0d04e4b0a 100644 --- a/site/package.json +++ b/site/package.json @@ -44,7 +44,6 @@ "build:storybook": "build-storybook" }, "resolutions": { - "prettier": "^2.5.1", "@mui/styled-engine": "npm:@mui/styled-engine-sc@latest" }, "dependencies": { @@ -123,8 +122,6 @@ "@types/recharts": "^1.8.16", "@types/serve-static": "^1.13.10", "@types/styled-components": "^5.1.9", - "@typescript-eslint/eslint-plugin": "^5.10.2", - "@typescript-eslint/parser": "^5.10.2", "@vitejs/plugin-legacy": "^1.6.4", "@vitejs/plugin-react": "=1.1.3", "babel-plugin-styled-components": "^2.0.2", @@ -132,15 +129,8 @@ "cypress-plugin-tab": "^1.0.5", "cypress-wait-until": "^1.7.2", "dotenv": "=8.1.0", - "eslint": "^8.8.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-cypress": "^2.12.1", - "eslint-plugin-mocha": "^10.0.3", - "eslint-plugin-react": "^7.28.0", - "eslint-plugin-react-hooks": "^4.3.0", "i18next-parser": "^6.0.0", "isomorphic-fetch": "^2.2.1", - "prettier": "^2.5.1", "rimraf": "^3.0.2", "rollup-plugin-toml": "^1.0.0", "serve-static": "^1.14.2", @@ -148,7 +138,7 @@ "ts-morph": "^13.0.3", "ts-node": "^10.5.0", "typescript": "^4.3.2", - "vite": "^2.7.13", + "vite": "^2.8.6", "vite-plugin-shim-react-pdf": "^1.0.4", "vitest": "^0.2.5", "xml2js": "^0.4.23", diff --git a/yarn.lock b/yarn.lock index 2f7d150a0..dacb65b9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2062,20 +2062,20 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^1.2.0": - version: 1.2.0 - resolution: "@eslint/eslintrc@npm:1.2.0" +"@eslint/eslintrc@npm:^1.2.1": + version: 1.2.1 + resolution: "@eslint/eslintrc@npm:1.2.1" dependencies: ajv: ^6.12.4 debug: ^4.3.2 espree: ^9.3.1 globals: ^13.9.0 - ignore: ^4.0.6 + ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.0.4 strip-json-comments: ^3.1.1 - checksum: a5e51dcf02627363567094456d7880b46b6a14a285d7a057f083ca903bdd862483bb6314cbc9fb6fa2d2c4537d50e0d28bd5e39650840241ae4796faaec65d2e + checksum: 1f797b9f94d71b965992cf6c44e3bcb574643014fd1e3d4862d25056bd5568f59c488461a7e9a1c1758ca7f0def5d3cb69c3d8b38581bcf4a53af74371243797 languageName: node linkType: hard @@ -5836,13 +5836,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.10.2": - version: 5.13.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.13.0" +"@typescript-eslint/eslint-plugin@npm:^5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.16.0" dependencies: - "@typescript-eslint/scope-manager": 5.13.0 - "@typescript-eslint/type-utils": 5.13.0 - "@typescript-eslint/utils": 5.13.0 + "@typescript-eslint/scope-manager": 5.16.0 + "@typescript-eslint/type-utils": 5.16.0 + "@typescript-eslint/utils": 5.16.0 debug: ^4.3.2 functional-red-black-tree: ^1.0.1 ignore: ^5.1.8 @@ -5855,42 +5855,42 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: ff8863b8c414eeed874c7ef4e5d540c918f9ee9be2e44fe30c6c22f2f59529a61e71afb3d7a90bff9a8f894098f11373989df91b11ef67a424c12f703021c174 + checksum: 4007cc1599503424037300e7401fb969ca441b122ef8a8f2fc8d70f84d656fdf7ab7b0d00e506a3aaf702871616c3756da17eb1508ff315dfb25170f2d28a904 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.10.2": - version: 5.13.0 - resolution: "@typescript-eslint/parser@npm:5.13.0" +"@typescript-eslint/parser@npm:^5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/parser@npm:5.16.0" dependencies: - "@typescript-eslint/scope-manager": 5.13.0 - "@typescript-eslint/types": 5.13.0 - "@typescript-eslint/typescript-estree": 5.13.0 + "@typescript-eslint/scope-manager": 5.16.0 + "@typescript-eslint/types": 5.16.0 + "@typescript-eslint/typescript-estree": 5.16.0 debug: ^4.3.2 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 9ca74f891df82f4f93150f0b69fcd2d9fb138c75a4629a154256108fbaa1248a96f69627cb472423890ff291e7cec30c20da25a87a21ef53fc1149ac9c18bfac + checksum: 40006578e9ac451c80dc4b4b7e29af97b53fb9e9ea660d6ca17fb98b5c9858c648f9b17523c9de9b9b9e4155af17b65435e6163f02c4a2dfacf48274f45cba21 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/scope-manager@npm:5.13.0" +"@typescript-eslint/scope-manager@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/scope-manager@npm:5.16.0" dependencies: - "@typescript-eslint/types": 5.13.0 - "@typescript-eslint/visitor-keys": 5.13.0 - checksum: 43fade6759e751387ee91f85033c036f122b5051f7ad7baf35fe5db68e2129afc1cc1c12c2b0b8a25eb206092ad1073d8e640b21f6b04824413f40751d8e0d42 + "@typescript-eslint/types": 5.16.0 + "@typescript-eslint/visitor-keys": 5.16.0 + checksum: 008a6607d3e6ebcc59a9b28cddcc25703f39a88e27a96c69a6d988acc50a1ea7dbf50963c165ffa5b85a101209a0da3a7ec6832633a162ca4ecc78c0e54acd9f languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/type-utils@npm:5.13.0" +"@typescript-eslint/type-utils@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/type-utils@npm:5.16.0" dependencies: - "@typescript-eslint/utils": 5.13.0 + "@typescript-eslint/utils": 5.16.0 debug: ^4.3.2 tsutils: ^3.21.0 peerDependencies: @@ -5898,23 +5898,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 454a2fe6c5faa211fec9d7992b44f377b9d492c3a18b8ce6d6da0077f0ea92320c7ee430cc33dcce8f0ec7afab7f8db59f39f9433be5358715754e64d7fbdef2 + checksum: 86d9f1dff6a096c8465453b8c7d0cc667b87a769f19073bfa9bbd36f8baa772c0384ec396b1132052383846bbbcf0d051345ed7d373260c1b506ed27100b383d languageName: node linkType: hard -"@typescript-eslint/types@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/types@npm:5.13.0" - checksum: 2228935a9f7e80264a554ffadc458ee184259b56cd987bf10f12754183e032953fb93b7b31f8261dd0a40dbac4f341d4904ae7aa1f1aba9f2a92b1062f05c8dc +"@typescript-eslint/types@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/types@npm:5.16.0" + checksum: 0450125741c3eef9581da0b75b4a987a633d77009cfb03507c3db29885b790ee80e3c0efc4f9a0dd3376ba758b49c7829722676153472616a57bb04bce5cc4fa languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.13.0" +"@typescript-eslint/typescript-estree@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.16.0" dependencies: - "@typescript-eslint/types": 5.13.0 - "@typescript-eslint/visitor-keys": 5.13.0 + "@typescript-eslint/types": 5.16.0 + "@typescript-eslint/visitor-keys": 5.16.0 debug: ^4.3.2 globby: ^11.0.4 is-glob: ^4.0.3 @@ -5923,33 +5923,33 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: bcf2f94eb4b8e0a5f47fa1e04478aa3f36c8d2b629300bf3d3a375f87e8046cd7f2364cd7df8fceb97855e7789721de5c66dafcf17cfd93552a93a7d7733dfdb + checksum: 930ead4655712c3bd40885fb6b2074cd3c10fb03da864dd7a7dd2e43abfd330bb07e505f0aec8b4846178bff8befbb017f9f3370c67e9c717e4cb8d3df6e16ef languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/utils@npm:5.13.0" +"@typescript-eslint/utils@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/utils@npm:5.16.0" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.13.0 - "@typescript-eslint/types": 5.13.0 - "@typescript-eslint/typescript-estree": 5.13.0 + "@typescript-eslint/scope-manager": 5.16.0 + "@typescript-eslint/types": 5.16.0 + "@typescript-eslint/typescript-estree": 5.16.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: cb93cddc83bd5f9cee7fc72ab64c509b285392a005fb1315522374991f18a1cb8f233ee0d1e828cc18570c3fe27e81cc28471c36142284bd39351b8a3f8a83bd + checksum: 46749091a204d7cf80d81b04704e23a86903a142a7e35cc5068a821c147c3bf098a7eff99af2b0e2ea7310013ca90300db9bab33ae5e3b5f773ed1d2961a5ed4 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.13.0": - version: 5.13.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.13.0" +"@typescript-eslint/visitor-keys@npm:5.16.0": + version: 5.16.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.16.0" dependencies: - "@typescript-eslint/types": 5.13.0 + "@typescript-eslint/types": 5.16.0 eslint-visitor-keys: ^3.0.0 - checksum: 3987217053e22a86f9105efe6250ca028ef437483b79d0dad45850edacfc273835b82178e77e5012a3c045df18561fef3eb4417cc26c328c901fbaa0da09e922 + checksum: b587bf3b0da95bb58ff877b75fefcee6472222de1e3ec76aa4b94cae66078b62a372c7d0343374a16aab15cdcbae3f9e019624028b35827f68ef6559389f7fd0 languageName: node linkType: hard @@ -10221,7 +10221,7 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:^8.3.0": +"eslint-config-prettier@npm:^8.5.0": version: 8.5.0 resolution: "eslint-config-prettier@npm:8.5.0" peerDependencies: @@ -10264,9 +10264,9 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react@npm:^7.28.0": - version: 7.29.2 - resolution: "eslint-plugin-react@npm:7.29.2" +"eslint-plugin-react@npm:^7.29.4": + version: 7.29.4 + resolution: "eslint-plugin-react@npm:7.29.4" dependencies: array-includes: ^3.1.4 array.prototype.flatmap: ^1.2.5 @@ -10284,7 +10284,7 @@ __metadata: string.prototype.matchall: ^4.0.6 peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - checksum: fcd793c0fd8e4570dcf8f70dd4afae9882303f4a4b650e09dac2f85fdc0b28747cb97b79832f4b8f4eabdbfb9edf69dc0ff04e8b7f33e0bb8e3f024185f4b037 + checksum: bb7d3715ccd7f3e0d7bfaa2125b26d96865695bcfea4a3d510a5763342a74ab5b99a88e13aad9245f9461ad87e4bce69c33fc946888115d576233f9b6e69700d languageName: node linkType: hard @@ -10343,11 +10343,11 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.10.0, eslint@npm:^8.8.0": - version: 8.10.0 - resolution: "eslint@npm:8.10.0" +"eslint@npm:^8.12.0": + version: 8.12.0 + resolution: "eslint@npm:8.12.0" dependencies: - "@eslint/eslintrc": ^1.2.0 + "@eslint/eslintrc": ^1.2.1 "@humanwhocodes/config-array": ^0.9.2 ajv: ^6.10.0 chalk: ^4.0.0 @@ -10384,7 +10384,7 @@ __metadata: v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: 8b31ab3de5b48b6828bf13c09c9e62ee0045fa0afa017efaa73eedcf4dc33bc204ee4c467d4677e37967d1645f73816ddef4271422e691fded352040f8f83093 + checksum: 111bf9046b7a463049788dd00d7f4cd91e024029982352dff4811ce5dfa8cb1136aa127cd8a7a91508234d3e1b4fb6f638a1f5ef9ea08b1af93a18703a4a8dc1 languageName: node linkType: hard @@ -12235,7 +12235,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^4.0.3, ignore@npm:^4.0.6": +"ignore@npm:^4.0.3": version: 4.0.6 resolution: "ignore@npm:4.0.6" checksum: 248f82e50a430906f9ee7f35e1158e3ec4c3971451dd9f99c9bc1548261b4db2b99709f60ac6c6cac9333494384176cc4cc9b07acbe42d52ac6a09cad734d800 @@ -15652,12 +15652,21 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.5.1": - version: 2.5.1 - resolution: "prettier@npm:2.5.1" +"prettier@npm:>=2.2.1 <=2.3.0": + version: 2.3.0 + resolution: "prettier@npm:2.3.0" bin: prettier: bin-prettier.js - checksum: 21b9408476ea1c544b0e45d51ceb94a84789ff92095abb710942d780c862d0daebdb29972d47f6b4d0f7ebbfb0ffbf56cc2cfa3e3e9d1cca54864af185b15b66 + checksum: e8851a45f60f2994775f96e07964646c299b8a8f9c64da4fbd8efafc20db3458bdcedac79aed34e1d5477540b3aa04f6499adc4979cb7937f8ebd058a767d8ff + languageName: node + linkType: hard + +"prettier@npm:^2.6.1": + version: 2.6.1 + resolution: "prettier@npm:2.6.1" + bin: + prettier: bin-prettier.js + checksum: 78be1f8a3ddfad7c3d8a854b6c8941a3bb1ddfca4225c38d778e0fe1029a55368f71b3bbefff82c689015fbb4d391ec44add957f01308ad2725e01a7c1f37cb6 languageName: node linkType: hard @@ -17160,8 +17169,15 @@ __metadata: version: 0.0.0-use.local resolution: "root@workspace:." dependencies: - eslint: ^8.10.0 - prettier: ^2.5.1 + "@typescript-eslint/eslint-plugin": ^5.16.0 + "@typescript-eslint/parser": ^5.16.0 + eslint: ^8.12.0 + eslint-config-prettier: ^8.5.0 + eslint-plugin-cypress: ^2.12.1 + eslint-plugin-mocha: ^10.0.3 + eslint-plugin-react: ^7.29.4 + eslint-plugin-react-hooks: ^4.3.0 + prettier: ^2.6.1 rimraf: ^3.0.2 languageName: unknown linkType: soft @@ -17629,8 +17645,6 @@ __metadata: "@types/recharts": ^1.8.16 "@types/serve-static": ^1.13.10 "@types/styled-components": ^5.1.9 - "@typescript-eslint/eslint-plugin": ^5.10.2 - "@typescript-eslint/parser": ^5.10.2 "@vitejs/plugin-legacy": ^1.6.4 "@vitejs/plugin-react": =1.1.3 algoliasearch: ^4.10.2 @@ -17639,19 +17653,12 @@ __metadata: cypress-plugin-tab: ^1.0.5 cypress-wait-until: ^1.7.2 dotenv: =8.1.0 - eslint: ^8.8.0 - eslint-config-prettier: ^8.3.0 - eslint-plugin-cypress: ^2.12.1 - eslint-plugin-mocha: ^10.0.3 - eslint-plugin-react: ^7.28.0 - eslint-plugin-react-hooks: ^4.3.0 fuse.js: ^6.4.6 i18next-parser: ^6.0.0 iframe-resizer: ^4.3.2 isomorphic-fetch: ^2.2.1 markdown-to-jsx: ^7.1.5 modele-social: ^0.6.0 - prettier: ^2.5.1 publicodes: ^1.0.0-beta.32 publicodes-react: ^1.0.0-beta.32 ramda: ^0.27.0 @@ -17680,7 +17687,7 @@ __metadata: ts-morph: ^13.0.3 ts-node: ^10.5.0 typescript: ^4.3.2 - vite: ^2.7.13 + vite: ^2.8.6 vite-plugin-shim-react-pdf: ^1.0.4 vitest: ^0.2.5 whatwg-fetch: ^3.0.0 @@ -19633,7 +19640,7 @@ __metadata: languageName: node linkType: hard -"vite@npm:>=2.7.13, vite@npm:^2.7.13": +"vite@npm:>=2.7.13, vite@npm:^2.8.6": version: 2.8.6 resolution: "vite@npm:2.8.6" dependencies: