Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 610 Bytes

File metadata and controls

44 lines (33 loc) · 610 Bytes

no-settimeout

This rule ensures no calls to setTimeout() are made.

ESLint Configuration

{
  "rules": {
    "ember-standard/no-settimeout": 2
  }
}

Valid

import Ember from 'ember'
const {run} = Ember

run.later(this, () => {
  // do something
}, 100)
setTimeout(() => {
  // do something
}, 100)

Note: In the above setTimeout is valid because Ember has not been imported. This serves useful in an Ember project for files outside of the normal app/addon files.

Invalid

import Ember from 'ember'

setTimeout(() => {
  // do something
}, 100)