From dba11d700ea2a3cd392be03a776fbc41a108e4ce Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 18 Mar 2021 15:27:01 -0400 Subject: [PATCH] add window.setTimeout and window.setInterval permanently, see phetsims/phet-info#59 --- eslint/rules/bad-sim-text.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/eslint/rules/bad-sim-text.js b/eslint/rules/bad-sim-text.js index a37b8b23..75ead7ee 100644 --- a/eslint/rules/bad-sim-text.js +++ b/eslint/rules/bad-sim-text.js @@ -49,18 +49,17 @@ module.exports = function( context ) { ' instanceof Touch ', // Should have a period before "<", see https://github.com/phetsims/chipper/issues/1005 - { id: 'Type', regex: /{[^\n ]*\b[A-z]+<[A-z]+>/ } + { id: 'Type', regex: /{[^\n ]*\b[A-z]+<[A-z]+>/ }, // In sims, don't allow setTimout and setInterval calls coming from window, see https://github.com/phetsims/phet-info/issues/59 - // TODO: comment back in when all lint errors are taken care of, https://github.com/phetsims/phet-info/issues/59 - // { - // id: 'setTimeout(', - // regex: /(window\.| )setTimeout\(/ - // }, - // { - // id: 'setInterval(', - // regex: /(window\.| )setInterval\(/ - // } + { + id: 'setTimeout(', + regex: /(window\.| )setTimeout\(/ + }, + { + id: 'setInterval(', + regex: /(window\.| )setInterval\(/ + } // DOT/Utils.toFixed or DOT/Utils.toFixedNumber should be used instead of toFixed. // JavaScript's toFixed is notoriously buggy. Behavior differs depending on browser,