From 969fb01d87d393f7bc120ef047343c83ff1bd405 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 14 May 2021 16:14:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=97=20S=C3=A9pare=20les=20configuratio?= =?UTF-8?q?ns=20tsconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- modele-social/tsconfig.json | 6 ++--- mon-entreprise/test/persistence.test.ts | 28 +++++++++++------------ mon-entreprise/tsconfig.json | 12 ++++++++-- publicodes/core/tsconfig.json | 2 +- publicodes/site/tsconfig.json | 2 +- tsconfig.json => publicodes/tsconfig.json | 0 publicodes/ui-react/tsconfig.json | 2 +- 8 files changed, 30 insertions(+), 24 deletions(-) rename tsconfig.json => publicodes/tsconfig.json (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 926164b5f..9c12a1792 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,7 +59,7 @@ module.exports = { "jsx": true }, "tsconfigRootDir": __dirname, - "project": [ "./tsconfig.json" ] + "project": [ "./mon-entreprise/tsconfig.json", "./publicodes/tsconfig.json" ] }, plugins: [ "@typescript-eslint" ], rules: { diff --git a/modele-social/tsconfig.json b/modele-social/tsconfig.json index 41aef4043..49fc71a60 100644 --- a/modele-social/tsconfig.json +++ b/modele-social/tsconfig.json @@ -1,8 +1,8 @@ { - "extends": "../tsconfig.json", "compilerOptions": { + "allowJs": true, "noEmit": true, "strict": true - }, - "include": ["build.js"] + }, + "include": ["build.js"] } diff --git a/mon-entreprise/test/persistence.test.ts b/mon-entreprise/test/persistence.test.ts index e487d81b7..2480db10f 100644 --- a/mon-entreprise/test/persistence.test.ts +++ b/mon-entreprise/test/persistence.test.ts @@ -1,23 +1,21 @@ import { expect } from 'chai' -import * as sinon from 'sinon' -import { createStore } from 'redux' import { createMemoryHistory } from 'history' - import { DottedName } from 'modele-social' +import { createStore } from 'redux' +import * as sinon from 'sinon' +import { + loadPreviousSimulation, + setSimulationConfig, + updateSituation, +} from '../source/actions/actions' import reducers, { Simulation, SimulationConfig, } from '../source/reducers/rootReducer' -import { PreviousSimulation } from '../source/selectors/previousSimulationSelectors' -import safeLocalStorage from '../source/storage/safeLocalStorage' import { setupSimulationPersistence } from '../source/storage/persistSimulation' -import { - loadPreviousSimulation, - updateSituation, - setSimulationConfig, -} from '../source/actions/actions' +import safeLocalStorage from '../source/storage/safeLocalStorage' -function delay(ms) { +function delay(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)) } @@ -40,15 +38,15 @@ const initialSimulation: Simulation = { describe('[persistence] When simulation persistence is setup', () => { const sandbox = sinon.createSandbox() - let spiedSafeLocalStorage - let store + let spiedSafeLocalStorage: any + let store: any beforeEach(() => { spiedSafeLocalStorage = sandbox.spy(safeLocalStorage as any) store = createStore(reducers, { simulation: initialSimulation, activeTargetInput: 'sometargetinput', - }) + } as any) setupSimulationPersistence(store, 0) }) @@ -81,7 +79,7 @@ describe('[persistence] When simulation config is set', () => { '{"situation":{"dotted name . other":"42"},"activeTargetInput":"someothertargetinput","foldedSteps":["someotherstep"]}' const sandbox = sinon.createSandbox() - let store + let store: any beforeEach(() => { sandbox diff --git a/mon-entreprise/tsconfig.json b/mon-entreprise/tsconfig.json index 1c60dc007..8da6ec135 100644 --- a/mon-entreprise/tsconfig.json +++ b/mon-entreprise/tsconfig.json @@ -1,7 +1,15 @@ { - "extends": "../tsconfig.json", "compilerOptions": { "baseUrl": "source", + "moduleResolution": "node", + "module": "esnext", + "target": "esnext", + "esModuleInterop": true, + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "allowJs": true, "paths": { "Actions/*": ["actions/*"], "Components": ["components"], @@ -14,5 +22,5 @@ "noEmit": true, "strict": true }, - "include": ["types", "source", "dev-server.js"] + "include": ["types", "source", "test/persistence.test.ts", "dev-server.js"] } diff --git a/publicodes/core/tsconfig.json b/publicodes/core/tsconfig.json index a71de8cce..ba37ce2e6 100644 --- a/publicodes/core/tsconfig.json +++ b/publicodes/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig.json", "compilerOptions": { "outDir": "./dist/types", "declaration": true, diff --git a/publicodes/site/tsconfig.json b/publicodes/site/tsconfig.json index 31eb5f5cb..aa35a7047 100644 --- a/publicodes/site/tsconfig.json +++ b/publicodes/site/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig.json", "compilerOptions": { "noEmit": true }, diff --git a/tsconfig.json b/publicodes/tsconfig.json similarity index 100% rename from tsconfig.json rename to publicodes/tsconfig.json diff --git a/publicodes/ui-react/tsconfig.json b/publicodes/ui-react/tsconfig.json index 05026a1d1..a1a9693bd 100644 --- a/publicodes/ui-react/tsconfig.json +++ b/publicodes/ui-react/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig.json", "compilerOptions": { "module": "CommonJS", "target": "es2015",