Skip to content

Commit

Permalink
Merge pull request #104 from retorquere/eslint
Browse files Browse the repository at this point in the history
Eslint cleanup
  • Loading branch information
willsALMANJ authored Aug 27, 2019
2 parents 2989927 + 4ddd50b commit 3e2b413
Show file tree
Hide file tree
Showing 31 changed files with 2,269 additions and 970 deletions.
277 changes: 277 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "off",
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"array-element-newline": "off",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": "error",
"block-scoped-var": "off",
"block-spacing": [
"error",
"never"
],
"brace-style": "off",
"callback-return": "error",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"comma-dangle": "error",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "error",
"curly": "off",
"default-case": "off",
"dot-location": "off",
"dot-notation": [
"error",
{
"allowKeywords": true
}
],
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": "off",
"function-paren-newline": "off",
"generator-star-spacing": "off",
"global-require": "error",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": "error",
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": "off",
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-classes-per-file": "off",
"max-depth": "off",
"max-len": ["error", { "code": 520, "ignoreComments": true }],
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"multiline-ternary": "off",
"new-parens": "off",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "off",
"no-bitwise": "error",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "error",
"no-console": "error",
"no-continue": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "off",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "error",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "error",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": [
"error",
{
"allowIndentationTabs": true
}
],
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "error",
"no-unused-vars": [ "error", { "argsIgnorePattern": "^_" } ],
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "off",
"no-void": "error",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "error",
"object-curly-spacing": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": [
"error",
"initializations"
],
"operator-assignment": "off",
"operator-linebreak": [
"error",
"after"
],
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-named-capture-group": "error",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "error",
"require-await": "error",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "off",
"semi-style": [
"error",
"last"
],
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "off",
"space-unary-ops": "error",
"spaced-comment": "off",
"strict": "error",
"switch-colon-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "error",
"yield-star-spacing": "error",
"yoda": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
build/
addon/chrome/locale/*/zutilo/README.html
Expand Down
4 changes: 2 additions & 2 deletions addon/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright 2012 Will Shanks.
Zutilo is licensed under a [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/) (full text below).
Zutilo is licensed under a [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/) (full text below).

Zotero is licensed under the Affero GPL 3.0.

Expand Down Expand Up @@ -42,7 +42,7 @@ Mozilla Public License Version 2.0
means any form of the work other than Source Code Form.

1.7. "Larger Work"
means a work that combines Covered Software with other material, in
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.

1.8. "License"
Expand Down
68 changes: 37 additions & 31 deletions addon/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
/* global Components, Services */
/* global Zutilo */
const {classes: Cc, utils: Cu} = Components;

Cu.import("resource://gre/modules/Services.jsm");

Expand All @@ -20,43 +22,47 @@ const BOOTSTRAP_REASONS = [
"ADDON_DOWNGRADE"
];

// eslint-disable-next-line no-unused-vars
function install(data, reason) {

}

// eslint-disable-next-line no-unused-vars
function startup(data, reason) {
Cu.import("chrome://zutilo/content/zutilo.jsm");
Zutilo.init();
Cu.import("chrome://zutilo/content/zutilo.jsm");
Zutilo.init();
}

// eslint-disable-next-line no-unused-vars
function shutdown(data, reason) {
if (reason == APP_SHUTDOWN) {
return;
}
var windows = Services.wm.getEnumerator('navigator:browser');
while (windows.hasMoreElements()) {
var tmpWin=windows.getNext();
tmpWin.ZutiloChrome.removeXUL();
if (typeof tmpWin.ZutiloChrome.firefoxOverlay != 'undefined') {
tmpWin.ZutiloChrome.firefoxOverlay.unload();
}
if (typeof tmpWin.ZutiloChrome.zoteroOverlay != 'undefined') {
tmpWin.ZutiloChrome.zoteroOverlay.unload();
}
delete tmpWin.ZutiloChrome;
delete tmpWin.Zutilo;
}
Zutilo.cleanup();
Cc["@mozilla.org/intl/stringbundle;1"].
getService(Components.interfaces.nsIStringBundleService).flushBundles();
Cu.unload("chrome://zutilo/content/zutilo.jsm");
if (reason == APP_SHUTDOWN) {
return;
}

var windows = Services.wm.getEnumerator('navigator:browser');
while (windows.hasMoreElements()) {
var tmpWin=windows.getNext();

tmpWin.ZutiloChrome.removeXUL();
if (typeof tmpWin.ZutiloChrome.firefoxOverlay != 'undefined') {
tmpWin.ZutiloChrome.firefoxOverlay.unload();
}
if (typeof tmpWin.ZutiloChrome.zoteroOverlay != 'undefined') {
tmpWin.ZutiloChrome.zoteroOverlay.unload();
}
delete tmpWin.ZutiloChrome;
delete tmpWin.Zutilo;
}

Zutilo.cleanup();

Cc["@mozilla.org/intl/stringbundle;1"].
getService(Components.interfaces.nsIStringBundleService).flushBundles();

Cu.unload("chrome://zutilo/content/zutilo.jsm");
}

// eslint-disable-next-line no-unused-vars
function uninstall(data, reason) {
}

}
Loading

0 comments on commit 3e2b413

Please sign in to comment.