Index: ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Barter.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Barter.js +++ ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Barter.js @@ -36,6 +36,7 @@ "metal": 1.0 } }; +let cmpBarter = ConstructComponent(SYSTEM_ENTITY, "Barter"); AddMock(SYSTEM_ENTITY, IID_Timer, { "CancelTimer": id => { timerActivated = false; }, @@ -47,8 +48,6 @@ } }); -let cmpBarter = ConstructComponent(SYSTEM_ENTITY, "Barter"); - // Init TS_ASSERT_EQUALS(cmpBarter.restoreTimer, undefined); TS_ASSERT_UNEVAL_EQUALS(cmpBarter.priceDifferences, { "wood": 0, "stone": 0, "metal": 0 }); Index: ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Foundation.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Foundation.js +++ ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Foundation.js @@ -18,6 +18,13 @@ { ResetState(); + let finalTemplate = "structures/athen_civil_centre.xml"; + let foundationHP = 1; + let maxHP = 100; + let rot = new Vector3D(1, 2, 3); + let pos = new Vector2D(4, 5); + let cmpFoundation; + AddMock(SYSTEM_ENTITY, IID_Trigger, { "CallEvent": () => {}, }); @@ -40,12 +47,6 @@ }); Engine.RegisterGlobal("MT_EntityRenamed", "entityRenamed"); - let finalTemplate = "structures/athen_civil_centre.xml"; - let foundationHP = 1; - let maxHP = 100; - let rot = new Vector3D(1, 2, 3); - let pos = new Vector2D(4, 5); - AddMock(foundationEnt, IID_Cost, { "GetBuildTime": () => 50, "GetResourceCosts": () => ({ "wood": 100 }), @@ -119,7 +120,7 @@ TS_ASSERT_EQUALS(template, "construction|" + finalTemplate); return previewEnt; }; - let cmpFoundation = ConstructComponent(foundationEnt, "Foundation", {}); + cmpFoundation = ConstructComponent(foundationEnt, "Foundation", {}); cmpFoundation.InitialiseConstruction(player, finalTemplate); TS_ASSERT_EQUALS(cmpFoundation.owner, player); Index: ps/trunk/build/jenkins/lint-config/eslintrc.json =================================================================== --- ps/trunk/build/jenkins/lint-config/eslintrc.json +++ ps/trunk/build/jenkins/lint-config/eslintrc.json @@ -19,6 +19,7 @@ "no-negated-in-lhs": 1, "no-obj-calls": 1, "no-unreachable": 1, + "no-use-before-define": ["error", "nofunc"], "use-isnan": 1, "valid-jsdoc": 0, "valid-typeof": 1,