diff --git a/.gitignore b/.gitignore index 7d13ee199..16a75280b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ yarn-error.log package-lock.json node_modules/ +.env # Local Netlify folder .netlify \ No newline at end of file diff --git a/mon-entreprise/source/components/ui/animate.tsx b/mon-entreprise/source/components/ui/animate.tsx index 9ed810d87..50024c591 100644 --- a/mon-entreprise/source/components/ui/animate.tsx +++ b/mon-entreprise/source/components/ui/animate.tsx @@ -99,7 +99,7 @@ export const leftToRight = ({ delay={delay} leave={{ opacity: 0, - position: 'absolute', + position: 'absolute' as const, transform: 'translateX(-100%)' }} items={children} diff --git a/mon-entreprise/source/components/utils/useNextQuestion.tsx b/mon-entreprise/source/components/utils/useNextQuestion.tsx index 45c717403..625853fe8 100644 --- a/mon-entreprise/source/components/utils/useNextQuestion.tsx +++ b/mon-entreprise/source/components/utils/useNextQuestion.tsx @@ -36,14 +36,18 @@ import { useMemo } from 'react' import { DottedName } from 'Rules' import { Simulation, SimulationConfig } from 'Reducers/rootReducer' -type MissingVariables = Array>> +type MissingVariables = Partial> export function getNextSteps( - missingVariables: MissingVariables + missingVariables: Array ): Array { const byCount = ([, [count]]) => count const byScore = ([, [, score]]) => score - const missingByTotalScore = reduce(mergeWith(add), {}, missingVariables) + const missingByTotalScore = reduce( + mergeWith(add), + {}, + missingVariables + ) const innerKeys = flatten(map(keys, missingVariables)), missingByTargetsAdvanced = countBy(identity, innerKeys) @@ -53,9 +57,9 @@ export function getNextSteps( missingByTargetsAdvanced, missingByTotalScore ), - pairs = toPairs(missingByCompound), + pairs = toPairs(missingByCompound), sortedPairs = sortWith([descend(byCount), descend(byScore) as any], pairs) - return map(head, sortedPairs) + return map(head, sortedPairs) as any } const similarity = (rule1 = '', rule2 = '') => @@ -67,7 +71,7 @@ const similarity = (rule1 = '', rule2 = '') => )(rule1.split(' . '), rule2.split(' . ')) export function getNextQuestions( - missingVariables: MissingVariables, + missingVariables: Array, questionConfig: SimulationConfig['questions'] = {}, answeredQuestions: Array = [], situation: Simulation['situation'] = {} diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx b/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx index a07e118e7..15238a279 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx +++ b/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx @@ -296,11 +296,11 @@ function IntegrationCode({ )}
src - ="https://mon-entreprise.fr/simulateur-iframe-integration.js"> + ="https://mon-entreprise.fr/simulateur-iframe-integration.js"{'>'} {'<'} / script - > + {'>'} ) } diff --git a/package.json b/package.json index fa8767c58..c0ec35dc0 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "source-map-support": "^0.5.4", "style-loader": "^0.23.1", "toml-loader": "^1.0.0", - "typescript": "^3.8.3", + "typescript": "^3.9.2", "url-loader": "^1.0.1", "webpack": "^4.39.3", "webpack-bundle-analyzer": "^3.7.0", @@ -121,7 +121,7 @@ "lint": "yarn lint:eslintrc && yarn lint:eslint && yarn lint:prettier", "test": "yarn workspaces run test", "prepare": "yarn workspace mon-entreprise run prepare", - "test:type": "yarn workspaces run tsc --noEmit", + "test:type": "yarn workspaces run tsc", "test:regressions": "jest", "link:publicodes": "yarn workspace publicodes link && yarn workspace mon-entreprise link publicodes" }, diff --git a/tsconfig.json b/tsconfig.json index 2539afd81..7b58e7456 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "allowJs": true, + "noEmit": true, // The end goal is to enable `"strict": true` which correspond to the // following settings: noImplicitAny, noImplicitThis, alwaysStrict, // strictBindCallApply, strictNullChecks, strictFunctionTypes, and diff --git a/yarn.lock b/yarn.lock index 90d1ada64..bd53894b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5944,7 +5944,7 @@ https-proxy-agent@^4.0.0: vue-template-compiler "^2.6.11" yamljs "^0.3.0" -i18next@^19.0.1, i18next@^19.4.4: +i18next@^19.0.1: version "19.4.4" resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.4.4.tgz#c0a18bc2f2be554da636e67bfbf5200c7948b60d" integrity sha512-ofaHtdsDdX3A5nYur1HWblB7J4hIcjr2ACdnwTAJgc8hTfPbyzZfGX0hVkKpI3vzDIgO6Uzc4v1ffW2W6gG6zw== @@ -9236,7 +9236,6 @@ public-encrypt@^4.0.0: version "1.0.0" dependencies: classnames "^2.2.6" - i18next "^19.4.4" moo "^0.5.1" nearley "^2.19.2" ramda "^0.27.0" @@ -11465,11 +11464,16 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.6.4, typescript@^3.8.3: +typescript@^3.6.4: version "3.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== +typescript@^3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" + integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw== + uglify-js@3.4.x: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f"