diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f64a197 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..e2a36a4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,11 @@ +{ + + "plugins": [ + "babel" + ], + + "rules": { + "arrow-parens": 0, + "babel/arrow-parens": 2 + } +} diff --git a/.gitignore b/.gitignore index 3c3629e..5148e52 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,37 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/index.js b/index.js index e69de29..8069d5a 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,8 @@ +import fetch from 'isomorphic-fetch' + +async function asyncer () { + let b = await fetch() + return b +} + +asyncer() diff --git a/package.json b/package.json index 4c0875a..c306787 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,18 @@ "description": "", "main": "index.js", "scripts": { - "test": "ava" + "test": "ava", + "watch-test": "ava --watch" }, "author": "", "license": "ISC", "devDependencies": { - "ava": "^0.14.0" + "ava": "^0.14.0", + "babel-eslint": "^6.0.3", + "eslint": "^2.8.0", + "eslint-plugin-babel": "^3.2.0" + }, + "standard": { + "parser": "babel-eslint" } } diff --git a/test.js b/test.js index 59dc6aa..4387723 100644 --- a/test.js +++ b/test.js @@ -1,21 +1,21 @@ -import test from 'ava'; +import test from 'ava' +import cb2 from './index' test('foo', t => { - t.pass(); -}); + t.pass() +}) test('bar', async t => { - const bar = Promise.resolve('bar'); - - t.is(await bar, 'bar'); -}); + const bar = Promise.resolve('bar') + t.is(await bar, 'bar') +}) -test('bilbo', t => { - t.pass(); +test('bilbo', t => { + t.pass() }) -test('bilbo', t => { - let a = 1 - t.is(a, 1) - t.pass() +test('bilbo', t => { + let a = 3 + t.is(a, 3) + t.pass() })