diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..b2f6ec6 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,12 @@ +ecmaFeatures: + modules: true + +env: + es6: true + browser: true + +extends: + "eslint:recommended" + +rules: + no-cond-assign: 0 diff --git a/package.json b/package.json index 71179b0..9cabd06 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "scripts": { "pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -u d3-timer -n d3_timer -o build/d3-timer.js -- build/bundle.js", - "test": "faucet `find test -name '*-test.js'`", + "test": "faucet `find test -name '*-test.js'` && eslint index.js src", "prepublish": "npm run test && uglifyjs build/d3-timer.js -c -m -o build/d3-timer.min.js && rm -f build/d3-timer.zip && zip -j build/d3-timer.zip -- LICENSE README.md build/d3-timer.js build/d3-timer.min.js" }, "devDependencies": { diff --git a/src/timer.js b/src/timer.js index b7d4acc..83191da 100644 --- a/src/timer.js +++ b/src/timer.js @@ -44,7 +44,7 @@ Timer.prototype = timer.prototype = { export function timer(callback, delay, time) { return new Timer(callback, delay, time); -}; +} export function timerFlush(time) { time = time == null ? Date.now() : +time; @@ -58,7 +58,7 @@ export function timerFlush(time) { } finally { --frame; } -}; +} function wake() { frame = timeout = 0;