diff --git a/.eslintrc.js b/.eslintrc.js index 22c1edcf2a..d1ba80edfc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -50,6 +50,10 @@ module.exports = { 'array-callback-return': 'error', 'no-template-curly-in-string': 'error', 'prefer-template': 'error', + 'no-param-reassign': 'error', + '@typescript-eslint/prefer-for-of': 'error', + 'prefer-arrow-callback': 'error', + 'no-var': 'error', eqeqeq: 'error', ...temporarilyDisabledRules } diff --git a/examples/motoko_examples/minimal-counter-dapp/src/minimal_dapp_assets/src/index.js b/examples/motoko_examples/minimal-counter-dapp/src/minimal_dapp_assets/src/index.js index e6424d7301..b8a7fe9ce7 100644 --- a/examples/motoko_examples/minimal-counter-dapp/src/minimal_dapp_assets/src/index.js +++ b/examples/motoko_examples/minimal-counter-dapp/src/minimal_dapp_assets/src/index.js @@ -1,6 +1,6 @@ import { minimal_dapp } from '../../declarations/minimal_dapp'; -document.addEventListener('DOMContentLoaded', async function () { +document.addEventListener('DOMContentLoaded', async () => { const counter = await minimal_dapp.getCount(); document.getElementById('counter').innerText = `Counter: ${counter}`; }); diff --git a/src/lib/globals.ts b/src/lib/globals.ts index 3d1b9318d3..631e0fb364 100644 --- a/src/lib/globals.ts +++ b/src/lib/globals.ts @@ -114,9 +114,7 @@ if (globalThis._azleInsideCanister) { instantiatedSource.instance.exports ); - for (let i = 0; i < exportEntries.length; i++) { - const [key, value] = exportEntries[i]; - + for (const [key, value] of exportEntries) { if (typeof value === 'function') { instantiatedSource.instance.exports[key] = value.bind({ instanceUuid: uuid, diff --git a/test/index.ts b/test/index.ts index 967238034b..a35dbf1761 100644 --- a/test/index.ts +++ b/test/index.ts @@ -34,9 +34,7 @@ export async function runTests( tests: Test[], exitProcess: boolean = true ): Promise { - for (let i = 0; i < tests.length; i++) { - const test = tests[i]; - + for (const test of tests) { try { if (test.skip === true) { console.log(`Skipping: ${test.name}`);