Merge pull request #31 from biancadanforth/eslint-multiline-statements

Add new ESLint rules. Fixes #29.
This commit is contained in:
Jonathan Kingston 2017-05-25 23:28:36 +01:00 коммит произвёл GitHub
Родитель 2b7d5a7286 f58f741693
Коммит 412ac62cd3
3 изменённых файлов: 65 добавлений и 11 удалений

Просмотреть файл

@ -6,19 +6,62 @@
"globals": {
"browser": true
},
"extends": "eslint:recommended",
"plugins": ["no-unsanitized"],
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": "2017"
},
"rules": {
"no-unsanitized/method": "error",
"no-unsanitized/property": "error",
"indent": [
"error",
2
2,
{
"CallExpression":
{ "arguments": 1 },
"FunctionDeclaration":
{ "parameters": 1 }
}
],
"linebreak-style": [
"error",
"unix"
],
"object-property-newline": [
"error"
],
"no-multi-assign": [
"error"
],
"no-new-object": [
"error"
],
"func-call-spacing": [
"error",
"never"
],
"brace-style": [
"error",
"1tbs"
],
"object-curly-newline": [
"error",
{"multiline": true}
],
"no-implied-eval": [
"error"
],
"operator-linebreak": [
"error",
"before"
],
"no-lonely-if": [
"error"
],
"no-multi-str": [
"error"
],
"prefer-const": [
"error"
],
@ -28,6 +71,17 @@
"require-await": [
"error"
],
"spaced-comment": [
"error",
"always"
],
"max-len": [
"error", {
"code": 80,
"tabWidth": 2,
"ignoreUrls": true
}
],
"semi": [
"error",
"always"

Просмотреть файл

@ -5,8 +5,9 @@ const capture = {
addListeners() {
// listen for each HTTP response
browser.webRequest.onResponseStarted.addListener(this.sendThirdParty, {urls: ['<all_urls>']}
);
browser.webRequest.onResponseStarted.addListener(
this.sendThirdParty,
{urls: ['<all_urls>']});
// listen for tab updates
browser.tabs.onUpdated.addListener(this.sendFirstParty);
},
@ -35,12 +36,10 @@ const capture = {
// ignore about:* pages and non-visible tabs
if (tab.status === 'complete'
&& tabUrl.protocol !== 'about:'
&& tabId !== browser.tabs.TAB_ID_NONE)
{
const firstPartyData = {
faviconUrl: tab.favIconUrl,
};
console.log('storage.firstPartyRequest:', tabUrl.hostname, firstPartyData);
&& tabId !== browser.tabs.TAB_ID_NONE) {
const firstPartyData = { faviconUrl: tab.favIconUrl };
console.log('storage.firstPartyRequest:',
tabUrl.hostname, firstPartyData);
}
}
};

Просмотреть файл

@ -17,6 +17,7 @@
},
"homepage": "https://github.com/pauljt/lightbeam-we#readme",
"devDependencies": {
"eslint": "^3.19.0"
"eslint": "^3.19.0",
"eslint-plugin-no-unsanitized": "^2.0.0"
}
}