mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
mv .gitignore. fix indents. update eslint config. use export and global to fix eslint errors
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
{
|
{
|
||||||
"globals": {"chrome": true},
|
"globals": {
|
||||||
|
"browser": true,
|
||||||
|
"chrome": true
|
||||||
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-set-state": "off"
|
"no-set-state": "off"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"es6": true
|
"es6": true
|
||||||
}
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
0
.gitignore → eslint-example/.gitignore
vendored
0
.gitignore → eslint-example/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
/* exported getUsefulContents */
|
||||||
// we cant use export here
|
// we cant use export here
|
||||||
function getUsefulContents(callback) {
|
function getUsefulContents(callback) {
|
||||||
callback('Hello World');
|
callback('Hello World');
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
// not supported in Firefox
|
/* global getUsefulContents */
|
||||||
// import { getUsefulContents } from "file";
|
// not supported in Firefox
|
||||||
|
// import { getUsefulContents } from "file";
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
getUsefulContents(data => {
|
getUsefulContents(data => {
|
||||||
var display = document.getElementById('display');
|
var display = document.getElementById('display');
|
||||||
|
|
||||||
display.innerHTML = data;
|
display.innerHTML = data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', start);
|
document.addEventListener('DOMContentLoaded', start);
|
||||||
Reference in New Issue
Block a user