diff --git a/eslint-example/.eslintrc.json b/eslint-example/.eslintrc.json index 2415576..51d8a7f 100644 --- a/eslint-example/.eslintrc.json +++ b/eslint-example/.eslintrc.json @@ -1,10 +1,16 @@ { - "globals": {"chrome": true}, + "globals": { + "browser": true, + "chrome": true + }, "rules": { "no-set-state": "off" }, "env": { - "browser": true, + "browser": true, "es6": true - } + }, + "extends": [ + "eslint:recommended" + ] } \ No newline at end of file diff --git a/.gitignore b/eslint-example/.gitignore similarity index 100% rename from .gitignore rename to eslint-example/.gitignore diff --git a/eslint-example/file.js b/eslint-example/file.js index b8a351f..998c8da 100644 --- a/eslint-example/file.js +++ b/eslint-example/file.js @@ -1,3 +1,4 @@ +/* exported getUsefulContents */ // we cant use export here function getUsefulContents(callback) { callback('Hello World'); diff --git a/eslint-example/main.js b/eslint-example/main.js index 72a34ce..9e480ba 100644 --- a/eslint-example/main.js +++ b/eslint-example/main.js @@ -1,12 +1,13 @@ - // not supported in Firefox - // import { getUsefulContents } from "file"; +/* global getUsefulContents */ +// not supported in Firefox +// import { getUsefulContents } from "file"; - function start() { - getUsefulContents(data => { - var display = document.getElementById('display'); +function start() { + getUsefulContents(data => { + var display = document.getElementById('display'); - display.innerHTML = data; - }); - } + display.innerHTML = data; + }); +} - document.addEventListener('DOMContentLoaded', start); \ No newline at end of file +document.addEventListener('DOMContentLoaded', start); \ No newline at end of file